[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] Problemer med g++?



> Hvordan vil I mene, at jeg skal fortolke følgende:
>
> /usr/lib/g++-include/iostream.h:50: warning: invalid type `void *' for default argument to `ostream *'
> /usr/lib/g++-include/iostream.h:123: warning: invalid type `void *' for default argument to `ostream *'
> /usr/lib/g++-include/iostream.h:231: warning: invalid type `void *' for default argument to `ostream *'

Fortolkningen er at makroen NULL forkert er blevet defineret som
(void*)0.
Højst sandsyligt inkluderer du noget *non-ansi* extern "C" før du
inkluderer <iostream.h>

ref:
Bjarne Stoustrup: The C++ Programming Language, 3rd. ed., 1st. printing
p. 88:
"In C, it has been popular to define a macro NULL to represent a zero
pointer. ..."

ISO/IEC 14882, First edition, 1998-09-01, p. 327:
"The macro NULL is an implementation defined C++ null pointer constant
in this International Standard..."
"...Possible definitions include 0 and 0L, but not (void*)0."


Hvis du ikke kan/vil ændre extern "C" koden må du
#undef NULL
#include <cstddef>

alternativt
#undef NULL
og definere NULL enten som makro jvf. ISO/IEC eller umidelbart som
const int NULL= 0; jvf. BS.

før du inkluderer <iostream.h>

Nils Åke Ljunggren
http://home12.inet.tele.dk/ngr


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:07 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *