Re: a few doubts!



(supersedes <mn.f4697d54b6147e54.15512@xxxxxxxxxxxxxx>)

Lew Pitcher wrote on 30/04/05 :
<...> infact the entire thing here works properly....so why
should it work properly??

The compiler is non-compliant? The compiler is broken?

None of this. The compiler is correct (KIM that the warnings are optional) and the behaviour is undefined. The OP is unlucky because the program doesn't crash.


--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html

"Clearly your code does not meet the original spec."
"You are sentenced to 30 lashes with a wet noodle."
-- Jerry Coffin in a.l.c.c++

.



Relevant Pages

  • Re: memcpy() and endianness
    ... > | Lew Pitcher wrote: ... And we haven't seen anything from the compiler to indicate ... an int as a 4-byte entity and a char as a 1-byte entity, ... Your int only holds the first two ...
    (comp.lang.c)
  • Re: help for program
    ... I suppose your compiler must accept them as an extension, ... Error: clf.f90: Explicit interface required for CREAALBEROF from\ ... I call this unlucky because it can mislead you into ... as I didn't try to fix it and then check further. ...
    (comp.lang.fortran)
  • Re: [C++] Omitted return statement
    ... | UDT. ... are we just getting unlucky? ... this sort of thing immediately, ... the compiler you are using let it go, ...
    (alt.comp.lang.learn.c-cpp)
  • Re: just want detail information
    ... ashu wrote: ... Because you were unlucky. ... If you were lucky, the compiler would have refused to compile this ... If you were using the compiler I have not yet written, ...
    (comp.lang.c)
  • Re: just want detail information
    ... Because you were unlucky. ... If you were lucky, the compiler would have refused to compile this ... If you were using the compiler I have not yet written, ... The line in question invokes undefined behaviour. ...
    (comp.lang.c)