Public bug reported:

Compiling a C++ program that only included standard headers should never
define or declare anything outside of namespace std.

However, try to compile this:

#include <cmath>
int y0;

>g++ junk.cc
junk.cc:3:5: error: ‘int y0’ redeclared as different kind of symbol
 int y0;
     ^
In file included from /usr/include/features.h:374:0,
                 from 
/usr/include/x86_64-linux-gnu/c++/4.8/bits/os_defines.h:39,
                 from 
/usr/include/x86_64-linux-gnu/c++/4.8/bits/c++config.h:426,
                 from /usr/include/c++/4.8/cmath:41,
                 from junk.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:240:1: error: previous 
declaration of ‘double y0(double)’
 __MATHCALL (y0,, (_Mdouble_));
 ^

The file in question defines a lot (which is supposedly on purpose for the C 
language with GNU extension),
which is shouldn't do that when compiling a C++ program.

** Affects: glibc (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1578857

Title:
  bits/mathcalls.h causes declarations in global namespace in C++

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1578857/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to