Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > List of implementation dependent parts of C standard

Reply
Thread Tools

List of implementation dependent parts of C standard

 
 
embeddedc@hotmail.com
Guest
Posts: n/a
 
      12-15-2006
Hi,

Referring to C90, is there somewhere published a list of all parts of
the standard where the behavior is not specified or implementation
dependent?

If not and I want to find all such parts I could search a pdf version
of the standard for keywords such as "implementation dependent" to
highlight the section. Can anybody suggest a complete list of such
keywords to make sure I find all the relevant sections?

Thank you.

 
Reply With Quote
 
 
 
 
Nick Keighley
Guest
Posts: n/a
 
      12-15-2006
wrote:

> Referring to C90, is there somewhere published a list of all parts of
> the standard where the behavior is not specified or implementation
> dependent?


appendices F.1 and F.3 of X3.159

> If not and I want to find all such parts I could search a pdf version
> of the standard for keywords such as "implementation dependent" to
> highlight the section. Can anybody suggest a complete list of such
> keywords to make sure I find all the relevant sections?



--
Nick Keighley

 
Reply With Quote
 
 
 
 
embeddedc@hotmail.com
Guest
Posts: n/a
 
      12-15-2006

Nick Keighley wrote:

> wrote:
>
> > Referring to C90, is there somewhere published a list of all parts of
> > the standard where the behavior is not specified or implementation
> > dependent?

>
> appendices F.1 and F.3 of X3.159
>
> > If not and I want to find all such parts I could search a pdf version
> > of the standard for keywords such as "implementation dependent" to
> > highlight the section. Can anybody suggest a complete list of such
> > keywords to make sure I find all the relevant sections?

>
>
> --
> Nick Keighley



Thank you for the information. It seems this document is not easy to
find. Seems ANSI no longer supply the 89 version (not surprising),
https://global.ihs.com can supply hard copy only, and I can get it in
the book "The Annotated ANSI C Standard by Herbert
Schildt". The last seems to be the best choice. Any other options?

 
Reply With Quote
 
Richard Heathfield
Guest
Posts: n/a
 
      12-15-2006
said:

<snip>

> Seems ANSI no longer supply the 89 version (not surprising),
> https://global.ihs.com can supply hard copy only, and I can get it in
> the book "The Annotated ANSI C Standard by Herbert
> Schildt". The last seems to be the best choice.


Provided you ignore the annotations, which are typically Schildtian, that's
the cheapest and best way to get hold of the Standard, although the book
does also contain at least one error in the text of the Standard itself.
The details are on Clive Feather's page, "The Annotated Annotated ANSI C
Standard", http://www.lysator.liu.se/c/schildt.html

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
 
Reply With Quote
 
embeddedc@hotmail.com
Guest
Posts: n/a
 
      12-15-2006

Richard Heathfield wrote:

> said:
>
> <snip>
>
> > Seems ANSI no longer supply the 89 version (not surprising),
> > https://global.ihs.com can supply hard copy only, and I can get it in
> > the book "The Annotated ANSI C Standard by Herbert
> > Schildt". The last seems to be the best choice.

>
> Provided you ignore the annotations, which are typically Schildtian, that's
> the cheapest and best way to get hold of the Standard, although the book
> does also contain at least one error in the text of the Standard itself.
> The details are on Clive Feather's page, "The Annotated Annotated ANSI C
> Standard", http://www.lysator.liu.se/c/schildt.html
>
> --
> Richard Heathfield
> "Usenet is a strange place" - dmr 29/7/1999
> http://www.cpax.org.uk
> email: rjh at the above domain, - www.



Just to check before I buy - the book contains the appendix F.1 and F.3?

 
Reply With Quote
 
Richard Heathfield
Guest
Posts: n/a
 
      12-15-2006
said:

>
> Richard Heathfield wrote:
>
>> said:
>>
>> <snip>
>>
>> > Seems ANSI no longer supply the 89 version (not surprising),
>> > https://global.ihs.com can supply hard copy only, and I can get it in
>> > the book "The Annotated ANSI C Standard by Herbert
>> > Schildt". The last seems to be the best choice.

>>
>> Provided you ignore the annotations, which are typically Schildtian,
>> that's the cheapest and best way to get hold of the Standard, although
>> the book does also contain at least one error in the text of the Standard
>> itself. The details are on Clive Feather's page, "The Annotated Annotated
>> ANSI C Standard", http://www.lysator.liu.se/c/schildt.html

>
> Just to check before I buy - the book contains the appendix F.1 and F.3?


Oh, good point. I have no idea. Sorry.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
 
Reply With Quote
 
Random832
Guest
Posts: n/a
 
      12-15-2006
2006-12-15 <>,
Richard Heathfield wrote:
> said:
>
> <snip>
>
>> Seems ANSI no longer supply the 89 version (not surprising),
>> https://global.ihs.com can supply hard copy only, and I can get it in
>> the book "The Annotated ANSI C Standard by Herbert
>> Schildt". The last seems to be the best choice.

>
> Provided you ignore the annotations, which are typically Schildtian, that's
> the cheapest and best way to get hold of the Standard, although the book
> does also contain at least one error in the text of the Standard itself.
> The details are on Clive Feather's page, "The Annotated Annotated ANSI C
> Standard", http://www.lysator.liu.se/c/schildt.html


Eh. Some of what that page says is a bit off.

} If main() is declared as void, I don't know of any compiler that will
} return 0. Indeed, the standard forbids it to !

The standard forbids no such thing. This is the most serious objection
I have, the rest of this post is just filler.

} if a signal can be raised within a library function (perhaps by an
} external event such as the user pressing a BREAK key), then the signal
} handler must not call that library function.

Is this really true for all library functions?

#include <signal.h>

void abrt(int) {
if(rand()%1) abort();
else _Exit(EXIT_SUCCESS); }
int main() {
signal(SIGABRT,abrt)
srand(time());
abort(); }

} There is no description of mktime and how it can be used to solve
} problems like "what day is 100 days after December 25th 1993 ?"

Is it really legal to add 100 days to a struct tm like this, or is it
just a consequence of the way common implementations work?
 
Reply With Quote
 
Ben Pfaff
Guest
Posts: n/a
 
      12-15-2006
Random832 <> writes:

> } There is no description of mktime and how it can be used to solve
> } problems like "what day is 100 days after December 25th 1993 ?"
>
> Is it really legal to add 100 days to a struct tm like this, or is it
> just a consequence of the way common implementations work?


It's standard behavior:

7.23.2.3 The mktime function

Synopsis

1 #include <time.h>
time_t mktime(struct tm *timeptr);

Description

2 The mktime function converts the broken-down time, expressed as
local time, in the structure pointed to by timeptr into a
calendar time value with the same encoding as that of the
values returned by the time function. The original values
of the tm_wday and tm_yday components of the structure are
ignored, and the original values of the other components are
not restricted to the ranges indicated above.267) On
successful completion, the values of the tm_wday and tm_yday
components of the structure are set appropriately, and the
other components are set to represent the specified calendar
time, but with their values forced to the ranges indicated
above; the final value of tm_mday is not set until tm_mon
and tm_year are determined.

--
"Welcome to the wonderful world of undefined behavior, where the demons
are nasal and the DeathStation users are nervous." --Daniel Fox
 
Reply With Quote
 
embeddedc@hotmail.com
Guest
Posts: n/a
 
      12-15-2006

wrote:

> Hi,
>
> Referring to C90, is there somewhere published a list of all parts of
> the standard where the behavior is not specified or implementation
> dependent?
>
> If not and I want to find all such parts I could search a pdf version
> of the standard for keywords such as "implementation dependent" to
> highlight the section. Can anybody suggest a complete list of such
> keywords to make sure I find all the relevant sections?
>
> Thank you.



On account that appendices F.1 and F.3 of X3.159 are not easy to come
by - changing tact a bit I explain my problem.

I want to document all parts of the standard that are not tightly
defined. I can get this information from C99, but the compiler is
likely neither 100% C99 nor 100% C89 compliant, therefore I also need
the information for the C89 standard.

Changes from C89 to C99 might have removed some of the implementation
dependent parts making C99 a subset of C89. Therefore if I only
document items relevant only C99 but the compiler is not completely C99
compliant I may miss some things.

If the parts of the standard that are implementation dependent are the
same in C89 as C99, or the C89 is a subset of those in C99 then I have
no problem - but how to prove?

Thanks for the comments so far.

 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      12-15-2006
Random832 <> writes:
> 2006-12-15 <>,
> Richard Heathfield wrote:
>> said:
>>
>> <snip>
>>
>>> Seems ANSI no longer supply the 89 version (not surprising),
>>> https://global.ihs.com can supply hard copy only, and I can get it in
>>> the book "The Annotated ANSI C Standard by Herbert
>>> Schildt". The last seems to be the best choice.

>>
>> Provided you ignore the annotations, which are typically Schildtian, that's
>> the cheapest and best way to get hold of the Standard, although the book
>> does also contain at least one error in the text of the Standard itself.
>> The details are on Clive Feather's page, "The Annotated Annotated ANSI C
>> Standard", http://www.lysator.liu.se/c/schildt.html

>
> Eh. Some of what that page says is a bit off.
>
> } If main() is declared as void, I don't know of any compiler that will
> } return 0. Indeed, the standard forbids it to !
>
> The standard forbids no such thing. This is the most serious objection
> I have, the rest of this post is just filler.


It depends on what you mean by "return 0". Certainly a program can
return the equivalent of an exit status of 0 to its calling
environment. But it's logically impossible for a void function to
return 0, or any other value. If main is declared as
"void main(void)", it cannot *as a function* return 0. I think that's
what Clive meant; possibly he misunderstood what Schildt meant. (My
copy of Schildt's book isn't handy, or I'd check.)

[..]

--
Keith Thompson (The_Other_Keith) kst- <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
non-dependent vs. dependent template names puzzlecracker C++ 1 08-07-2008 07:42 AM
Serious issue: parts of my page render as not logged in, parts as logged in. Help! pcloches@gmail.com ASP .Net 1 04-12-2007 12:50 AM
Difference between "library parts" of C99 and "language parts" of C99 albert.neu@gmail.com C Programming 3 03-31-2007 08:14 PM
Parts parts....PARTS!!! ARGHHH dstvns A+ Certification 8 01-07-2004 07:57 PM
How come most multi parts dont have all parts? 123 Computer Support 2 09-22-2003 01:55 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57