[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OFF TOPIC] was: Segfault in free()...C++



> > 
> > On Sep  4, 1997, at 09:10, E.L. Meijer (Eric) wrote:
> >  > Jeff Gunter:
> >  > Wildly off topic, but a fun view into `commercial quality software', let
> >  > me show you the output of CC under IRIX 64 with the following
> >  > application:
> >  > 
> >  > hw.cc:
> >  > ------------------------------------------------------------------------
> >  > #include <iostream.h>
> >  > int main() { cout << "Hello world." << endl; return 0; }
> >  > ------------------------------------------------------------------------
> >  > > CC -fullwarn -o hw hw.cc
> >  > "/usr/include/CC/iostream.h", line 236: remark(1506): implicit
> >  > conversion from
> >  >           "long" to "int":  rounding, sign extension, or loss of
> >  > accuracy may
> >  >           result
> >  >                 x_blen= (eb>b) ? (eb-b) : 0 ;
> >  >                         ^
> >  > 
> >  > "/usr/include/CC/iostream.h", line 265: remark(1506): implicit
> >  > conversion from
> >  >           "long" to "int":  rounding, sign extension, or loss of
> >  > accuracy may
> >  >           result
> >  >                 return x_gptr<x_egptr ? x_egptr-x_gptr : 0 ;
> >  >                        ^
> >  > 
> >  > "/usr/include/CC/iostream.h", line 270: remark(1506): implicit
> >  > conversion from
> >  >           "long" to "int":  rounding, sign extension, or loss of
> >  > accuracy may
> >  >           result
> >  >                 if ( x_pptr ) return x_pptr-x_pbase ;
> >  >                                      ^
> >  > 
> >  > "/usr/include/CC/iostream.h", line 646: remark(1430): omission of
> >  > "class" is
> >  >           nonstandard
> >  >         friend          ios ;
> >  >                         ^
> >  > 
> >  > "/usr/include/CC/iostream.h", line 650: remark(1174): variable
> >  > "iostream_init"
> >  >           was declared but never referenced
> >  >   } iostream_init ;     
> >  >     ^
> >  > ------------------------------------------------------------------------
> >  > The 64 bit compiler doesn't seem to agree with itself!
> > 
> > Well, "remarks" are just that: comments the compiler has regarding
> > some non-standard, perhaps non-portable and not-so-secure assumptions
> > you MAY have made in your code.
> 
> You didn't look carefully enough, or you don't understand what is
> there.  These warnings are about a header file that ships with the
> compiler, not about my code!  

Oh well, that's nothing. You have to thank this compiler for being able to
compile at all. I encountered the situation on IRIX when including some
two particular header files (I already forgot which ones) makes compiler
fail because the same function is declaread in both .h's but differently:
one with "const" and another without :(

Alex Y.

> I usually want my code to compile cleanly
> at the highest warning level.  It becomes very hard to check if there
> are any warnings in my code if the compiler reports loads of drivel in
> its system headers.  Besides that things like `implicit conversion from
> long to int' are not necessarily harmless.
> 
> > Nothing more, nothing less. They can
> > be safely ignored for the greatest part.
> 
> `Safely ignoring' warnings is the ultimate route to creating software
> that will be hard to maintain and difficult to port, IMHO.

Completely agree with you.

> 
> Eric Meijer
> 
> -- 
>  E.L. Meijer (tgakem@chem.tue.nl)          | tel. office +31 40 2472189
>  Eindhoven Univ. of Technology             | tel. lab.   +31 40 2475032
>  Lab. for Catalysis and Inorg. Chem. (TAK) | tel. fax    +31 40 2455054

-- 
   _ 
 _( )_
(     (o___           +-------------------------------------------+
 |      _ 7           |            Alexander Yukhimets            |
  \    (")            |       http://pages.nyu.edu/~aqy6633/      |
  /     \ \           +-------------------------------------------+


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: