Modify

Ticket #487 (closed Bug: Fixed)

Opened 2 years ago

Last modified 21 months ago

[patch] symbols conflicting with SUSv4 API

Reported by: gahr Owned by: kwo
Priority: Critical Milestone:
Component: e16 Keywords:
Cc: Blocked By:
Blocking:

Description

Systems implementing The Open Group Base Specifications Issue 7 interface literally, i.e., using the same parameters names as specified in the API, have conflict problems because of symbols defined by the e16 API.

The sigset(2) function declared in [1] uses a parameter named disp, which is also #define'd by xwin.h as #define disp Dpy.disp.

When xwin.h is included before signal.h (happens in main.c, session.c and setup.c), the parameter name gets substituted during the preprocessor phase as void (*sigset(int sig, void (*Dpy.disp)(int)))(int);

which is clearly a sintax error.

A workaround would be to include standard API files first and e16 includes second. A patch is attached.

IMHO, it would be better to apply the same kind of change to all files, i.e. include first <>'s, then ""'.

[1]  http://www.opengroup.org/onlinepubs/9699919799/functions/sigset.html

Attachments

patch-signal Download (1.8 KB) - added by gahr 2 years ago.
patch-src_text_pango.c Download (395 bytes) - added by gahr 2 years ago.
Patch for text_pango.c

Change History

Changed 2 years ago by gahr

comment:1 follow-up: ↓ 2 Changed 2 years ago by kwo

Patch committed, thanks :)

IMHO, it would be better to apply the same kind of change to all files, i.e. include first <>'s, then ""'.

Yes, that is probably a good idea. One thing though, "config.h" should be included before the <>'s because it defines _GNU_SOURCE, and USE_... defines sometimes used to determine which <>'s are included.

comment:2 in reply to: ↑ 1 Changed 2 years ago by gahr

Replying to kwo:

Patch committed, thanks :)

IMHO, it would be better to apply the same kind of change to all files, i.e. include first <>'s, then ""'.

Yes, that is probably a good idea. One thing though, "config.h" should be included before the <>'s because it defines _GNU_SOURCE, and USE_... defines sometimes used to determine which <>'s are included.

Oh yes, that's the exception for sure! I will prepare a patch for the whole bunch of .c files if you would like me to.

comment:3 Changed 2 years ago by kwo

That would be nice :)

comment:4 Changed 2 years ago by kwo

  • Status changed from new to closed
  • Resolution set to Fixed

Original problem is fixed.

comment:5 Changed 2 years ago by gahr

  • Status changed from closed to reopened
  • Resolution Fixed deleted

I haven't had time to prepare a patch for the whole codebase, but I'd need this one to be committed in order to make font_pango.c compile.

Thanks Kim!

Changed 2 years ago by gahr

Patch for text_pango.c

comment:6 Changed 2 years ago by kwo

  • Status changed from reopened to new

Committed, except that I have kept #include "xwin.h" because I don't think it should be assumed that it is included by tclass.h.

Thanks :)

comment:7 Changed 21 months ago by kwo

  • Status changed from new to closed
  • Resolution set to Fixed

I removed the "#define disp ..." which caused all the problems a while back.

I don't think it is worth while to do the suggested header file rearrangements any longer.

comment:8 Changed 21 months ago by gahr

Agreed. Moreover, I won't have the time to prepare a full patch in the near future ;)

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.