Ticket #487 (closed Bug: Fixed)
[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
Change History
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: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!
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 :)

