On Sun, 11 Dec 2011 15:43:02 +0100 (CET), Mark Kettenis wrote:
> > Date: Sun, 11 Dec 2011 13:37:29 +0100
> > From: Pascal Stumpf  <pascal.stu...@cubes.de>
> > 
> > On Thu, 17 Nov 2011 19:06:24 +0100, Pascal Stumpf wrote:
> > > Hi,
> > > this diff was already suggested by matthew@ some time ago.  It renders
> > > clang++ usable with gcc's C++ include files, see:
> > > 
> > > http://marc.info/?l=openbsd-tech&m=130229126704450&w=2
> > > 
> > > I don't expect any fallout, but just to be sure, can this go through a
> > > bulk build on affected platforms (gcc4)?
> > > 
> > > 
> > > 
> > > Index: os_defines.h
> > > ===================================================================
> > > RCS file: /cvs/src/gnu/gcc/libstdc++-v3/config/os/bsd/openbsd/os_defines.
> h,v
> > > retrieving revision 1.2
> > > diff -u -p -r1.2 os_defines.h
> > > --- os_defines.h  26 May 2010 11:23:06 -0000      1.2
> > > +++ os_defines.h  17 Nov 2011 18:04:55 -0000
> > > @@ -35,12 +35,6 @@
> > >  // file will come before all others.
> > >  
> > >  #define _GLIBCXX_USE_C99 1
> > > -#define _GLIBCXX_USE_C99_CHECK 1
> > > -#define _GLIBCXX_USE_C99_DYNAMIC (!(__ISO_C_VISIBLE >= 1999))
> > > -#define _GLIBCXX_USE_C99_LONG_LONG_CHECK 1
> > > -#define _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC (_GLIBCXX_USE_C99_DYNAMIC || 
> !def
> > > ined __LONG_LONG_SUPPORTED)
> > > -#define _GLIBCXX_USE_C99_FLOAT_TRANSCENDENTALS_CHECK 1
> > > -#define _GLIBCXX_USE_C99_FLOAT_TRANSCENDENTALS_DYNAMIC defined _XOPEN_SO
> URCE
> > >  typedef __builtin_va_list __gnuc_va_list;
> > >  
> > >  #endif
> > > 
> > > 
> > 
> > ping?
> 
> I still think this should be investigated deeper.  Matthew did a bit
> of digging jusdging from:
> 
>    http://marc.info/?l=openbsd-ports&m=129783295016631&w=2
> 
> That raises the question what difference between the prototypes makes
> clang++ barf.  If it is only thye missing restrict qualifiers, we
> should add those to our prototypes.
> 
> As far as I can tell, the #defines that get removed by the diff do
> serve a purpose.  Without them, compiling
> 
>    #include <cstdio>
> 
> with
> 
>   g++ -D_POSIX_C_SOURCE=199309
> 
> will fail.
> 
> 

Hmm, okay.  Adding __restrict to the prototypes in stdio.h and
s/restrict/__restrict/g in cstdio gets rid of some errors, but not all
of them.  So there still seems to be some difference it doesn't like,
but apparently, I'm totally blind as to which one.


In file included from cstdio.cc:1:
/usr/include/g++/cstdio:169:11: error: target of using declaration conflicts 
with declaration already in scope
  using ::snprintf;
          ^
In file included from cstdio.cc:1:
In file included from /usr/include/g++/cstdio:52:
/usr/include/stdio.h:271:6: note: target of using declaration
int      snprintf(char * __restrict, size_t, const char * __restrict, ...)
         ^
In file included from cstdio.cc:1:
/usr/include/g++/cstdio:158:4: note: conflicting declaration
  (snprintf)(char * __restrict, size_t, const char * __restrict, ...);
   ^
/usr/include/g++/cstdio:170:11: error: target of using declaration conflicts 
with declaration already in scope
  using ::vfscanf;
          ^
In file included from cstdio.cc:1:
In file included from /usr/include/g++/cstdio:52:
/usr/include/stdio.h:275:6: note: target of using declaration
int      vfscanf(FILE * __restrict, const char * __restrict, __va_list)
         ^
In file included from cstdio.cc:1:
/usr/include/g++/cstdio:160:4: note: conflicting declaration
  (vfscanf)(FILE * __restrict, const char * __restrict, __gnuc_va_list);
   ^
/usr/include/g++/cstdio:171:11: error: target of using declaration conflicts 
with declaration already in scope
  using ::vscanf;
          ^
In file included from cstdio.cc:1:
In file included from /usr/include/g++/cstdio:52:
/usr/include/stdio.h:278:6: note: target of using declaration
int      vscanf(const char * __restrict, __va_list)
         ^
In file included from cstdio.cc:1:
/usr/include/g++/cstdio:161:19: note: conflicting declaration
  extern "C" int (vscanf)(const char * __restrict, __gnuc_va_list);
                  ^
/usr/include/g++/cstdio:172:11: error: target of using declaration conflicts 
with declaration already in scope
  using ::vsnprintf;
          ^
In file included from cstdio.cc:1:
In file included from /usr/include/g++/cstdio:52:
/usr/include/stdio.h:281:6: note: target of using declaration
int      vsnprintf(char * __restrict, size_t, const char * __restrict, 
__va_list)
         ^
In file included from cstdio.cc:1:
/usr/include/g++/cstdio:163:4: note: conflicting declaration
  (vsnprintf)(char * __restrict, size_t, const char * __restrict, 
__gnuc_va_list);
   ^
/usr/include/g++/cstdio:173:11: error: target of using declaration conflicts 
with declaration already in scope
  using ::vsscanf;
          ^
In file included from cstdio.cc:1:
In file included from /usr/include/g++/cstdio:52:
/usr/include/stdio.h:285:6: note: target of using declaration
int      vsscanf(const char * __restrict, const char * __restrict, __va_list)
         ^
In file included from cstdio.cc:1:
/usr/include/g++/cstdio:165:4: note: conflicting declaration
  (vsscanf)(const char * __restrict, const char * __restrict, __gnuc_va_list);
   ^
5 errors generated.

Reply via email to