After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 90551 - libbonobo/bonobo/Bonobo.h uses reserved symbols
libbonobo/bonobo/Bonobo.h uses reserved symbols
Status: RESOLVED WONTFIX
Product: bonobo
Classification: Deprecated
Component: libbonobo
CVS HEAD
Other All
: Normal major
: ---
Assigned To: Michael Meeks
Luis Villa
Depends on:
Blocks:
 
 
Reported: 2002-08-12 14:03 UTC by Morten Welinder
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Morten Welinder 2002-08-12 14:03:20 UTC
typedef struct
{
...
      void (*read) (PortableServer_Servant _servant, const CORBA_long count,
		    Bonobo_Stream_iobuf ** buffer, CORBA_Environment * ev);
}

"read" is reserved by the C library and may be a macro.
Same thing for "write", "truncate", "seek", and maybe others.

(This file was generated.  Maybe the culprit is elsewhere.)
Comment 1 Michael Meeks 2002-08-12 16:40:50 UTC
unfixable due to API freeze;

if your system defines 'read' as a macro; you're going to be screwed
anyway IMHO.
Comment 2 Morten Welinder 2002-08-12 20:23:05 UTC
Michael, I'm serious:

> grep '[^f]truncate.*truncate64' /usr/include/unistd.h 
#pragma redefine_extname        truncate        truncate64
#define truncate                        truncate64

All libc functions can be macros, possibly excluding some longjmp
related ones.  I seem to remember that quite a lot of glibc users
got caught red-eared when glibc made printf a macro.

Have a look at http://bugzilla.gnome.org/show_bug.cgi?id=71184


Conclusion: the code is buggy.  Reconsider WONTFIX.  At least put
on list of things to fix when API changes are allowed again.  In the
long run "standards don't apply to me" is not viable.
Comment 3 Michael Meeks 2002-08-13 01:37:02 UTC
Sigh; it's really not very possible to fix this one;

Can you take the discussion onto gnome-hackers so we can get some more
errudite input.

I don't really want to change every Stream/Storage read/write to
something else (what ?) - I mean, it just sucks utterly.

It's really not clear to me what to do; I imagine the real solution is
for whomever creates these defines to define their read thusly:

#define read(a,b,c) foobarbrokenread(a,b,c)

Rather than just screwing with the 'read' name globally.
Comment 4 Kjartan Maraas 2003-05-11 10:43:42 UTC
Did this discussion ever happen?
Comment 5 Morten Welinder 2003-05-11 21:57:24 UTC
Yes and no.  In one of this bugs' sisters, it was make pretty clear to
me that people don't feel the standard applies to them in this matter.
(Apparently writing "Read" is much harder than writing "read".)
Comment 6 Michael Meeks 2003-05-12 10:24:22 UTC
'Read' breaks the method naming convention; perhaps readBytes or
something would do - but that breaks the API freeze - so we just can't
win.

So - we get to choose whether we screw people with broken OS' that do
stupid things with parameterless macros, or whether we break API
compatibility for every program that uses Stream;