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 504119 - Please bring g_assert* back in gmessages.h
Please bring g_assert* back in gmessages.h
Status: RESOLVED WONTFIX
Product: glib
Classification: Platform
Component: general
2.14.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2007-12-17 20:29 UTC by Marko Anastasov
Modified: 2008-03-31 08:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Marko Anastasov 2007-12-17 20:29:19 UTC
It is an API break to not be able to use these macros by including the original header. I think that people should continue to be able to use them as they have been using them for a long time.
Comment 1 Tim Janik 2007-12-17 20:44:54 UTC
the "API" for glib is to include "glib.h" if you want to use anything.
doing so will provide you with a working g_assert() definition.
providing g_assert in gmessages.h would unnecessarily include gtestutils.h. 
Comment 2 Murray Cumming 2007-12-17 22:51:47 UTC
> the "API" for glib is to include "glib.h" if you want to use anything.

According to what documentation? I don't see how you can so happily break compilation of applications.
Comment 3 Paul Davis 2008-03-25 12:19:59 UTC
footnote: if everything in glib is included by <glib.h>, then presumably both gmessages.h and gtestutils.h are included, since otherwise some part of the API would be missing. it is therefore a rather cruel irony to claim that some other option would "unnecessarily include gtestutils.h", when <glib.h> unnecessarily includes every single glib header that exists.

murray, i checked and it is true that the docs for all the glib APIs all say to just include <glib.h> (or they do now). 
Comment 4 Tim Janik 2008-03-31 08:14:14 UTC
(In reply to comment #3)
> footnote: if everything in glib is included by <glib.h>, then presumably both
> gmessages.h and gtestutils.h are included, since otherwise some part of the API
> would be missing.

correct, glib.h includes gmessages.h and gtestutils.h.

> it is therefore a rather cruel irony to claim that some other
> option would "unnecessarily include gtestutils.h",

"unnecessarily include gtestutils.h" as in unneccessary for glib internal compilation of course. you're right that it doesn't matter for someone including glib.h.

> when <glib.h> unnecessarily
> includes every single glib header that exists.

glib.h including all public glib headers is indeed neccessary, it is the one and only header file that exposes the glib API. the only file people are supposed to be including.