Re: compiling and gcc2.7.0

From: Andrew Dorrell <andrewd_at_ee.uts.edu.au>
Date: Thu, 23 May 1996 14:50:42 +1000 (EST)

>
> Just a note on portability -
>
> stk.h includes string.h and memory.h. When STk is compiled using C++,
> the entire stk.h file is enclosed in an extern "C" environment. For
> some reason which I haven't taken the time to determine, including
> string.h and memory.h in such an environment bombs the compilation
> with g++2.7.0. I have have no problem with 2.7.2 or 2.6.3.
> Moving the includes of string.h and memory.h outside of the extern "C"
> solves the problem in 2.7.0.
> Jon
>
> This was the error:
> /usr/local/gnu/lib/g++-include/std/cstring.h: In function `char * strchr(char *, int)':
> In file included from /usr/local/gnu/lib/g++-include/cstring:5,
> from /usr/local/gnu/lib/g++-include/string.h:5,
> from /usr/local/packages/STk/build/Src/stk.h:39,
> from STkTemplateFiles.cc:2:
> /usr/local/gnu/lib/g++-include/std/cstring.h:34: declaration of C function `char * strchr(char *, int)' conflicts with
> /usr/local/gnu/lib/g++-include/std/cstring.h:31: previous declaration `char * strchr(const char *, int)' here
> ....
> ...
> ...

This is a known bug with g++2.7.0. I do not believe it is the
responsibility of STk to cope with this---It is after all a C program.
The thing I do find a little odd is that there is and extern "C" {...}
statement in stk.h at all! Surely it is the responsibility of the C++
source file to wrap C header files as appropriate, and the
responsibility of the C++ compiler to cope with that without barfing
;-).


-- 
------------------------------------------------------------------------------
Mr Andrew Dorrell
School of Electrical Engineering                 *
University of Technology, Sydney                     *
PO Box 123                                     *
Broadway NSW 2007                                   .  
AUSTRALIA
                                                    *       /---\  Whoo?
Phone:   61 2 330 2395                                      (o o) /
Fax:     61 2 330 2435                                      ( : )  
email:   andrewd_at_ee.uts.edu.au                               ^ ^     
    OR   dorrell_at_ihf.uts.edu.au
------------------------------------------------------------------------------
Received on Thu May 23 1996 - 06:52:56 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST