https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69126

Stephan Bergmann <sbergman at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sbergman at redhat dot com

--- Comment #18 from Stephan Bergmann <sbergman at redhat dot com> ---
A GCC trunk build past r232893 started causing building LibreOffice to fail now
for me, with a _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
coming from a macro expansion being ignored, thus causing a
-Werror=deprecated-declarations.

I cannot easily reduce the test case further than what I have below.  I tried
to expand the remaining includes inline in the main source file, but then ran
into strange effects where e.g. removing an arbitrary single line from the
middle of a multi-line /*...*/ comment made the problem go away, while
replacing the line with an empty line made the problem stay.  The first
#include is for a file coming from LO's own bundled Boost, the remaining
#includes are from the (F22, x86_64) system.  (Also, the problem only happens
with -O or higher.)

> $ cat test.cc
> #include <boost/property_tree/json_parser.hpp>
> #define __GDK_H_INSIDE__
> #include <gdk/gdkversionmacros.h>
> #include <gdk/gdkscreen.h>
> #include <gdk/gdkcairo.h>
> #include <gdk/gdkcursor.h>
>
> #define IGNORE _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
> __attribute__((deprecated)) void f();
> int main() {
>     IGNORE
>     f();
> }

> $ /home/sbergman/gcc/trunk/inst/bin/g++ -Werror -O -c test.cc \
>  -I/home/sbergman/lo/core/workdir/UnpackedTarball/boost \
>  -I/usr/include/gtk-3.0 -I/usr/include/cairo -I/usr/include/pango-1.0 \
>  -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 \
>  -I/usr/lib64/glib-2.0/include
>
> test.cc: In function ‘int main()’:
> test.cc:12:5: error: ‘void f()’ is deprecated 
> [-Werror=deprecated-declarations]
>      f();
>      ^
> test.cc:9:34: note: declared here
>  __attribute__((deprecated)) void f();
>                                   ^
> test.cc:12:7: error: ‘void f()’ is deprecated 
> [-Werror=deprecated-declarations]
>      f();
>        ^
> test.cc:9:34: note: declared here
>  __attribute__((deprecated)) void f();
>                                   ^
> cc1plus: all warnings being treated as errors

Reply via email to