public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* fixinc regression for <math.h> with C++ on Solaris 9
@ 2004-01-19 19:46 Gerald Pfeifer
  2004-01-19 20:04 ` Gabriel Dos Reis
  2004-01-19 20:38 ` Bruce Korb
  0 siblings, 2 replies; 10+ messages in thread
From: Gerald Pfeifer @ 2004-01-19 19:46 UTC (permalink / raw)
  To: Bruce Korb; +Cc: gcc, Eric Botcazou

[ C++ gurus, below there is a four-liner which I believe to be
  valid C++, but a double check would be appreciated. ]

Hi Bruce,

the following difference between the fixincluded math.h on
sparc-sun-solaris2.9 seems to be responsible for a regression:

  /sw/gcc-3.2.3/lib/gcc-lib/sparc-sun-solaris2.9/3.2.3/include/math.h
  /sw/gcc-current/lib/gcc/sparc-sun-solaris2.9/3.5.0/include/math.h
  @@ -7,12 +7,6 @@
       This had to be done to correct non-standard usages in the
       original, manufacturer supplied header file.  */

  -#ifndef FIXINC_WRAP_MATH_H_MATH_EXCEPTION
  -#define FIXINC_WRAP_MATH_H_MATH_EXCEPTION 1
  -
  -#ifdef __cplusplus
  -#define exception __math_exception
  -#endif
   /*
    * Copyright 00/09/07 Sun Microsystems, Inc.  All Rights Reserved.
    */
  @@ -255,8 +249,3 @@ extern float modff __P((float, float *))
   #endif

   #endif /* _MATH_H */
  -#ifdef __cplusplus
  -#undef exception
  -#endif
  -
  -#endif  /* FIXINC_WRAP_MATH_H_MATH_EXCEPTION */

For the following C++ program

  #include <stdexcept>
  using namespace std;
  #include <cmath>

  int main() { return 0; }

we now get

  In file included from /sw/gcc-current/lib/gcc/sparc-sun-solaris2.9/3.5.0/../../../../include/c++/3.5.0/cmath:52,
     from x.cc:3:
  /sw/gcc-current/lib/gcc/sparc-sun-solaris2.9/3.5.0/include/math.h:202:
     error: use of `exception' is ambiguous
  /sw/gcc-current/lib/gcc/sparc-sun-solaris2.9/3.5.0/include/math.h:99:
    error:   first declared as `struct exception' here
  /sw/gcc-current/lib/gcc/sparc-sun-solaris2.9/3.5.0/../../../../include/c++/3.5.0/exception:53:
    error:   also declared as `class std::exception' here
  /sw/gcc-current/lib/gcc/sparc-sun-solaris2.9/3.5.0/include/math.h:202:
    error: conflicting declaration 'struct exception'
  /sw/gcc-current/lib/gcc/sparc-sun-solaris2.9/3.5.0/include/math.h:99:
    error: 'struct exception' has a previous declaration as `struct exception'

Gerald
-- 
Gerald Pfeifer (Jerry)   gerald@pfeifer.com   http://www.pfeifer.com/gerald/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-01-20 21:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-19 19:46 fixinc regression for <math.h> with C++ on Solaris 9 Gerald Pfeifer
2004-01-19 20:04 ` Gabriel Dos Reis
2004-01-19 20:38 ` Bruce Korb
2004-01-19 21:06   ` Gerald Pfeifer
2004-01-19 21:20     ` Bruce Korb
2004-01-20 18:49       ` Gerald Pfeifer
2004-01-20 20:50         ` Nathanael Nerode
2004-01-20 20:42       ` Nathanael Nerode
2004-01-20 21:14         ` Bruce Korb
2004-01-20 20:39     ` Nathanael Nerode

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).