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 726136 - use && instead of 'and' in deprecation warnings
use && instead of 'and' in deprecation warnings
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-03-11 22:33 UTC by Balint Reczey
Modified: 2014-03-13 21:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
the patch (1.04 KB, patch)
2014-03-12 14:53 UTC, Balint Reczey
none Details | Review

Description Balint Reczey 2014-03-11 22:33:39 UTC
'and' is a C++ keyword and -Wc++-compat finds it
Comment 1 Matthias Clasen 2014-03-12 01:24:06 UTC
can you give some examples in gtk headers where this would be relevant ?
(asking about headers because I don't really care if gtk+ itself is free of such warnings)
Comment 2 Balint Reczey 2014-03-12 10:17:19 UTC
It breaks compilation of _other_ software using -Werror -Wc++-compat, such as Wireshark.
Thanks to the presence of this we can't use -Wc++-compat in GTK+ related part.
Comment 3 Matthias Clasen 2014-03-12 14:37:49 UTC
 could you provide some logs that show examples of the breakage, please ?
Comment 4 Balint Reczey 2014-03-12 14:53:26 UTC
Created attachment 271606 [details] [review]
the patch
Comment 5 Emmanuele Bassi (:ebassi) 2014-03-12 14:57:08 UTC
that's not what Matthias asked.

also, that "and" goes into an attribute text field, not in a compilation unit, so it should never trigger a c++-compat warning. on top of that, the whole header is conditionally dependent on an `extern "C" { }` block.

can you please attach a compilation log?
Comment 6 Balint Reczey 2014-03-12 15:00:54 UTC
On Debian testing (GTK+ 3.10)

$ echo -e '#include <gtk/gtk.h>\nmain(){};' > test.c
$ gcc -I $(pkg-config --cflags gtk+-3.0) $(pkg-config --cflags glib-2.0) -Werror -Wc++-compat test.c
In file included from /usr/include/gtk-3.0/gtk/gtkapplication.h:27:0,
                 from /usr/include/gtk-3.0/gtk/gtkwindow.h:33,
                 from /usr/include/gtk-3.0/gtk/gtkdialog.h:33,
                 from /usr/include/gtk-3.0/gtk/gtkaboutdialog.h:30,
                 from /usr/include/gtk-3.0/gtk/gtk.h:31,
                 from test.c:1:
/usr/include/gtk-3.0/gtk/gtkwidget.h:945:58: error: identifier "and" is a special operator name in C++ [-Werror=c++-compat]
 GDK_DEPRECATED_IN_3_0_FOR(gtk_widget_get_preferred_width and gtk_widget_get_preferred_height)
                                                          ^
cc1: all warnings being treated as errors
Comment 7 Balint Reczey 2014-03-12 15:02:56 UTC
@Emmanuele: It was clear what Matthias asked, I just noticed that I forgot adding the patch for this second bug report.
Comment 8 Matthias Clasen 2014-03-13 02:37:52 UTC
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40564 seems related
Comment 9 Balint Reczey 2014-03-13 21:25:59 UTC
Thank you for fixing that. The fix may also be a good candidate for back-porting to 3.10.x IMHO.