Bug 49120 - C++ code including <complex> fails when using -pedantic due to hypot redeclaration.
C++ code including <complex> fails when using -pedantic due to hypot redeclar...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: libstdc++ (Show other bugs)
7.1
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-07-13 20:27 EDT by Mumit Khan
Modified: 2007-04-18 12:34 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-03-08 08:49:36 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
C++ <complex> hypot bug description, with preprocessed source. (46.17 KB, text/plain)
2001-07-13 20:28 EDT, Mumit Khan
no flags Details

  None (edit)
Description Mumit Khan 2001-07-13 20:27:23 EDT
Bug details:
============

Even the most trivial C++ program that includes <complex> fails to compile
in combination with -pedantic due to conflicting declaration of hypot().

System and GCC RPM information
===============================
$ cat /etc/issue
Red Hat Linux release 7.1 (Seawolf)
Kernel 2.4.3-12 on an i686

[ All packages up-to-date as of 2001-07-12 using up2date ]

$ rpm -qa|grep gcc
gcc-objc-2.96-85
gcc-2.96-85
gcc-g77-2.96-85
gcc-c++-2.96-85
gcc-chill-2.96-85
gcc-java-2.96-85
$ rpm -qa|grep libstdc++
libstdc++-2.96-85
libstdc++-devel-2.96-85
 
Source
======
$ cat hypot-bug.cc
#include <complex>

 
Compiler invocation and error output
====================================
 
$ gcc -c -v -save-temps -pedantic hypot-bug.cc
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/cpp0 -lang-c++ -D__GNUG__=2
-D__EXCEPTIONS -v -D__GNUC__=2 -D__GNUC_MINOR__=96 -D__GNUC_PATCHLEVEL__=0
-D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix
-D__linux -Asystem(posix) -D__NO_INLINE__ -pedantic -Acpu(i386)
-Amachine(i386) -Di386 -D__i386 -D__i386__ -D__tune_i386__ hypot-bug.cc
hypot-bug.ii
GNU CPP version 2.96 20000731 (Red Hat Linux 7.1 2.96-85) (cpplib) (i386
Linux/ELF)
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/i386-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/g++-3
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/cc1plus hypot-bug.ii -quiet
-dumpbase hypot-bug.cc -pedantic -version -o hypot-bug.s
GNU C++ version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)
(i386-redhat-linux) compiled by GNU C version 2.96 20000731 (Red Hat Linux
7.1 2.96-85).
In file included from /usr/include/g++-3/complex:7,
                 from hypot-bug.cc:1:
/usr/include/g++-3/std/complext.h:314: declaration of `double hypot
(double, double)' throws different exceptions
/usr/include/bits/mathcalls.h:150: than previous declaration `double
hypot (double, double) throw ()'
Comment 1 Mumit Khan 2001-07-13 20:28:45 EDT
Created attachment 23587 [details]
C++ <complex> hypot bug description, with preprocessed source.
Comment 2 Jakub Jelinek 2001-07-17 03:49:56 EDT
Will be fixed in libstdc++-devel-2.96-95 (is already in my tree).
Comment 3 Miloslav Trmac 2004-03-08 08:49:36 EST
Fix confirmed in libstdc++-3.3.2-1.

Note You need to log in before you can comment on or make changes to this bug.