Thank you
The error message on stderr and the program termination via an abort()
call are guaranteed.
What is implementation-defined is the format of the error message
and the effect of calling abort() (beyond the fact that the program will
be terminated).
Dan
--
Dan Pop
CERN, IT Division
Email: Dan...@cern.ch
Mail: CERN - IT, Bat. 31 1-014, CH-1211 Geneve 23, Switzerland
What it writes exactly is implementation-defined. That it does write
something, including file name, line number, and the assert()ed
expression, and then calls abort(), is ISO-defined (to coin a term).
Richard
Regarding abort () : not always.
In Diab Data D-CC Optimizing C compiler (using in pSOS)
the program doesn't terminate its running.
P.S. That behavior is not ANSI C one.
>
> What is implementation-defined is the format of the error message
> and the effect of calling abort() (beyond the fact that the program will
> be terminated).
>
> Dan
> --
> Dan Pop
> CERN, IT Division
> Email: Dan...@cern.ch
> Mail: CERN - IT, Bat. 31 1-014, CH-1211 Geneve 23, Switzerland
============================
Alex Vinokur
mailto:ale...@bigfoot.com
http://go.to/alexv_math
============================
==================================
Posted via http://nodevice.com
Linux Programmer's Site
> > In <3a891e8d$1...@news.starhub.net.sg> "sam" <s...@singnet.com.sg> writes:
> >
> > >Is the behaviour of macro assert in the header file assert.h
> > >implementation-defined, ie will the system always print an error message
> > >when the value of the expression tested is 0 ?
> >
> > The error message on stderr and the program termination via an abort()
> > call are guaranteed.
>
> Regarding abort () : not always.
> In Diab Data D-CC Optimizing C compiler (using in pSOS)
> the program doesn't terminate its running.
>
> P.S. That behavior is not ANSI C one.
Then what is the point of bringing it up in an ANSI C context?
--
"You call this a *C* question? What the hell are you smoking?" --Kaz
>> In <3a891e8d$1...@news.starhub.net.sg> "sam" <s...@singnet.com.sg> writes:
>>
>> >Is the behaviour of macro assert in the header file assert.h
>> >implementation-defined, ie will the system always print an error message
>> >when the value of the expression tested is 0 ?
>>
>> The error message on stderr and the program termination via an abort()
>> call are guaranteed.
>
>Regarding abort () : not always.
Always, in hosted C implementations.
>In Diab Data D-CC Optimizing C compiler (using in pSOS)
> the program doesn't terminate its running.
Then, Diab Data D-CC is not a hosted C implementation.
>P.S. That behavior is not ANSI C one.
It actually is, if the implementation doesn't claim to be a hosted C
implementation. A freestanding implementation can attach any meaning
it wants to the abort() function, if it chooses to provide one at all.
Thanks for this information.
How can we know if specific compiler is a freestanding implementation?
P.S. I didn't find relevant information in Diab compiler description.
Must this information be in compiler description? (Does ANSI C require it?)
>
> Dan
> --
> Dan Pop
> CERN, IT Division
> Email: Dan...@cern.ch
> Mail: CERN - IT, Bat. 31 1-014, CH-1211 Geneve 23, Switzerland
Alex Vinokur