http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59472

            Bug ID: 59472
           Summary: Many warnings "type of 'X' does not match original
                    declaration" when linking with libstdc++ static
                    library compiled with -flto
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: d.g.gorbachev at gmail dot com

$ cat > hello.cc
#include <iostream>

int main()
{
  std::cout << "Hello, world\n";
  return 0;
}
^D
$ g++ -flto hello.cc
../../../../../gcc-4.9/libstdc++-v3/src/c++98/ios_init.cc:66:18: warning: type
of 'cin' does not match original declaration [enabled by default]
../../../../../gcc-4.9/libstdc++-v3/src/c++98/globals_io.cc:56:16: note:
previously declared here
../../../../../gcc-4.9/libstdc++-v3/src/c++98/ios_init.cc:68:18: warning: type
of 'cerr' does not match original declaration [enabled by default]
../../../../../gcc-4.9/libstdc++-v3/src/c++98/globals_io.cc:58:16: note:
previously declared here
../../../../../gcc-4.9/libstdc++-v3/src/c++98/ios_init.cc:69:18: warning: type
of 'clog' does not match original declaration [enabled by default]
../../../../../gcc-4.9/libstdc++-v3/src/c++98/globals_io.cc:59:16: note:
previously declared here
../../../../../gcc-4.9/libstdc++-v3/src/c++98/ios_init.cc:72:19: warning: type
of 'wcin' does not match original declaration [enabled by default]
../../../../../gcc-4.9/libstdc++-v3/src/c++98/globals_io.cc:66:17: note:
previously declared here
../../../../../gcc-4.9/libstdc++-v3/src/c++98/ios_init.cc:73:19: warning: type
of 'wcout' does not match original declaration [enabled by default]
../../../../../gcc-4.9/libstdc++-v3/src/c++98/globals_io.cc:67:17: note:
previously declared here
../../../../../gcc-4.9/libstdc++-v3/src/c++98/ios_init.cc:74:19: warning: type
of 'wcerr' does not match original declaration [enabled by default]
../../../../../gcc-4.9/libstdc++-v3/src/c++98/globals_io.cc:68:17: note:
previously declared here
../../../../../gcc-4.9/libstdc++-v3/src/c++98/ios_init.cc:75:19: warning: type
of 'wclog' does not match original declaration [enabled by default]
../../../../../gcc-4.9/libstdc++-v3/src/c++98/globals_io.cc:69:17: note:
previously declared here
../../../../../gcc-4.9/libstdc++-v3/src/c++98/ios_init.cc:41:35: warning: type
of 'buf_cout_sync' does not match original declaration [enabled by default]
../../../../../gcc-4.9/libstdc++-v3/src/c++98/globals_io.cc:84:17: note:
previously declared here
../../../../../gcc-4.9/libstdc++-v3/src/c++98/ios_init.cc:42:35: warning: type
of 'buf_cin_sync' does not match original declaration [enabled by default]
../../../../../gcc-4.9/libstdc++-v3/src/c++98/globals_io.cc:85:17: note:
previously declared here
../../../../../gcc-4.9/libstdc++-v3/src/c++98/ios_init.cc:43:35: warning: type
of 'buf_cerr_sync' does not match original declaration [enabled by default]
../../../../../gcc-4.9/libstdc++-v3/src/c++98/globals_io.cc:86:17: note:
previously declared here
../../../../../gcc-4.9/libstdc++-v3/src/c++98/ios_init.cc:45:30: warning: type
of 'buf_cout' does not match original declaration [enabled by default]
../../../../../gcc-4.9/libstdc++-v3/src/c++98/globals_io.cc:90:16: note:
previously declared here
../../../../../gcc-4.9/libstdc++-v3/src/c++98/ios_init.cc:46:30: warning: type
of 'buf_cin' does not match original declaration [enabled by default]
../../../../../gcc-4.9/libstdc++-v3/src/c++98/globals_io.cc:91:16: note:
previously declared here
../../../../../gcc-4.9/libstdc++-v3/src/c++98/ios_init.cc:47:30: warning: type
of 'buf_cerr' does not match original declaration [enabled by default]
../../../../../gcc-4.9/libstdc++-v3/src/c++98/globals_io.cc:92:16: note:
previously declared here
../../../../../gcc-4.9/libstdc++-v3/src/c++98/ios_init.cc:50:38: warning: type
of 'buf_wcout_sync' does not match original declaration [enabled by default]
../../../../../gcc-4.9/libstdc++-v3/src/c++98/globals_io.cc:97:18: note:
previously declared here
../../../../../gcc-4.9/libstdc++-v3/src/c++98/ios_init.cc:51:38: warning: type
of 'buf_wcin_sync' does not match original declaration [enabled by default]
../../../../../gcc-4.9/libstdc++-v3/src/c++98/globals_io.cc:98:18: note:
previously declared here
../../../../../gcc-4.9/libstdc++-v3/src/c++98/ios_init.cc:52:38: warning: type
of 'buf_wcerr_sync' does not match original declaration [enabled by default]
../../../../../gcc-4.9/libstdc++-v3/src/c++98/globals_io.cc:99:18: note:
previously declared here
../../../../../gcc-4.9/libstdc++-v3/src/c++98/ios_init.cc:54:33: warning: type
of 'buf_wcout' does not match original declaration [enabled by default]
../../../../../gcc-4.9/libstdc++-v3/src/c++98/globals_io.cc:103:17: note:
previously declared here
../../../../../gcc-4.9/libstdc++-v3/src/c++98/ios_init.cc:55:33: warning: type
of 'buf_wcin' does not match original declaration [enabled by default]
../../../../../gcc-4.9/libstdc++-v3/src/c++98/globals_io.cc:104:17: note:
previously declared here
../../../../../gcc-4.9/libstdc++-v3/src/c++98/ios_init.cc:56:33: warning: type
of 'buf_wcerr' does not match original declaration [enabled by default]
../../../../../gcc-4.9/libstdc++-v3/src/c++98/globals_io.cc:105:17: note:
previously declared here
/usr/local/lib/gcc/i686-pc-linux-gnu/4.9.0/include/c++/iostream:61:18: warning:
type of 'cout' does not match original declaration [enabled by default]
   extern ostream cout;  /// Linked to standard output
                  ^
../../../../../gcc-4.9/libstdc++-v3/src/c++98/ios_init.cc:67:18: warning: type
of 'cout' does not match original declaration [enabled by default]
../../../../../gcc-4.9/libstdc++-v3/src/c++98/globals_io.cc:57:16: note:
previously declared here

(To reproduce it, libstdc++ should be compiled with LTO (for example, by
passing --enable-cxx-flags='-flto -ffat-lto-objects' to the configure script).)

These warnings cause some displeasure, and there is no way to disable them.

Reply via email to