From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52906 invoked by alias); 26 Feb 2015 19:30:10 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 52866 invoked by uid 48); 26 Feb 2015 19:30:06 -0000 From: "Bert.Wesarg at googlemail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug plugins/65227] New: Plugin headers are unusable when included after inttypes.h Date: Thu, 26 Feb 2015 20:30:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: plugins X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: Bert.Wesarg at googlemail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-02/txt/msg02972.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65227 Bug ID: 65227 Summary: Plugin headers are unusable when included after inttypes.h Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: major Priority: P3 Component: plugins Assignee: unassigned at gcc dot gnu.org Reporter: Bert.Wesarg at googlemail dot com GCC 5 20150215 Snapshot. When the gcc-plugin.h header is included after the inttypes.h header, than the compilation breaks. Used compiler: $ g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/home/wesarg/opt/gcc-5-20150215/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../configure --prefix=/home/wesarg/opt/gcc-5-20150215 --enable-languages=c,c++,fortran --disable-nls --enable-checking=yes --disable-werror Thread model: posix gcc version 5.0.0 20150215 (experimental) (GCC) Compiling the attached file, which includes inttypes.h before gcc-plugin.h results in this error: $ g++ -save-temps -c -I$(g++ -print-file-name=plugin/include) no-inttypes-pri-macros.cc In file included from /home/wesarg/opt/gcc-5-20150215/lib/gcc/x86_64-unknown-linux-gnu/5.0.0/plugin/include/double-int.h:23:0, from /home/wesarg/opt/gcc-5-20150215/lib/gcc/x86_64-unknown-linux-gnu/5.0.0/plugin/include/gcc-plugin.h:52, from no-inttypes-pri-macros.cc:2: /home/wesarg/opt/gcc-5-20150215/lib/gcc/x86_64-unknown-linux-gnu/5.0.0/plugin/include/wide-int.h: In member function 'void generic_wide_int::dump() const': /home/wesarg/opt/gcc-5-20150215/lib/gcc/x86_64-unknown-linux-gnu/5.0.0/plugin/include/wide-int.h:877:26: error: expected ')' before 'PRIx64' fprintf (stderr, HOST_WIDE_INT_PRINT_HEX ",", val[len - 1 - i]); ^ In file included from /home/wesarg/opt/gcc-5-20150215/lib/gcc/x86_64-unknown-linux-gnu/5.0.0/plugin/include/double-int.h:23:0, from /home/wesarg/opt/gcc-5-20150215/lib/gcc/x86_64-unknown-linux-gnu/5.0.0/plugin/include/gcc-plugin.h:52, from no-inttypes-pri-macros.cc:2: /home/wesarg/opt/gcc-5-20150215/lib/gcc/x86_64-unknown-linux-gnu/5.0.0/plugin/include/wide-int.h:878:24: error: expected ')' before 'PRIx64' fprintf (stderr, HOST_WIDE_INT_PRINT_HEX "], precision = %d\n", ^ The reason seems to be, that system.h defines __STDC_FORMAT_MACROS, than conditionally includes inttypes.h, and later hwint.h relys that this conditional include has resulted in the definition of the PRI macros. But that is not the case as the the include in system.h is not the first inclusion of this header.