C99 (TC3) and 'official' discussions.

D

Doug

Hi folks,

I'm new to this group but I've been working with C, C++, Java, abit of
assembly, and the learners favourite VB. Anyway, I'm working on a
project for my Doctorate and needed some help and advice. I'm looking
for a (preferrably electronic) copy of the C99 standard TC3 (I found
TC2 easily, TC3 seems to be hard to get at the moment unless I missed
it somehow).

Further, although I know boards like this are great for getting
helpful advice about C, I was hoping to be directed to 'official'
discussions with minutes or similar (working groups, standards
committees, that sort of thing) for the sake of research and sourcing.
Pacifically, I'm looking presently for talks about the preprocessor
phase of compiling and unspecified or ambiguous area's of the
standard. For example, if one were to run purely from the standard,
its justifiable either way as to whether 'sizeOf' and type-casts are
accepted as apart of a #if conditional.

Anyway, thanks in advance for any help or assistance rendered ;)
Doug
 
K

Keith Thompson

Doug said:
I'm new to this group but I've been working with C, C++, Java, abit of
assembly, and the learners favourite VB. Anyway, I'm working on a
project for my Doctorate and needed some help and advice. I'm looking
for a (preferrably electronic) copy of the C99 standard TC3 (I found
TC2 easily, TC3 seems to be hard to get at the moment unless I missed
it somehow).

It's n1235.pdf, available at
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1235.pdf

Other documents of interest:

n1124.pdf (C99 + TC1 + TC2, with change bars)
n1256.pdf (C99 + TC1 + TC2 + TC3, with change bars)

TC1 and TC2 are probably available as nXXXX.pdf documents, but I got
them as free downloads from webstore.ansi.org. You can get the
original C99 standard from there, but it costs money (I paid $18 US; I
think it's higher now).

Note that n1124 and n1256 are not officially approved documents, but
they're close enough for most purposes. As I understand it, the C99
standard and the TC documents are official; n1256 is derived from
them, but has not itself gone through the same process.
Further, although I know boards like this are great for getting
helpful advice about C, I was hoping to be directed to 'official'
discussions with minutes or similar (working groups, standards
committees, that sort of thing) for the sake of research and sourcing.

(Quibble: this is a newsgroup, not a "board".)

The committee's web site is <http://www.open-std.org/JTC1/SC22/WG14/>.

Questions about standard documents and the process used to create them
are better directed to comp.std.c.
Pacifically, I'm looking presently for talks about the preprocessor
phase of compiling and unspecified or ambiguous area's of the
standard. For example, if one were to run purely from the standard,
its justifiable either way as to whether 'sizeOf' and type-casts are
accepted as apart of a #if conditional.

That's incorrect. sizeof is not recognized by the preprocessor; in an
"#if" condition, it's just another identifier. casts are not allowed.
See C99 6.10.1p1:

The expression that controls conditional inclusion shall be an
integer constant expression except that: it shall not contain a
cast; identifiers (including those lexically identical to
keywords) are interpreted as described below;
[...]

(I've omitted discussion of the "defined" operator.) The identifier
``sizeof'', used in a #if condition, expands to 0 unless it's been
defined as a macro. (Defining ``sizeof'' as a macro would be a really
bad idea.)

If you can point to wording in the standard that suggests otherwise,
I'd be interested in seeing it. (Note that since this is a discussion
of the language defined by the standard, as opposed to the standard as
a document, it's topical here in comp.lang.c.)
 
W

Walter Roberson

Doug said:
Pacifically, I'm looking presently for talks about the preprocessor
phase of compiling and unspecified or ambiguous area's of the
standard. For example, if one were to run purely from the standard,
its justifiable either way as to whether 'sizeOf' and type-casts are
accepted as apart of a #if conditional.

C89 3.8.1 Conditional Inclusion
has no room for ambiguity in those matters.

Constraints

The expression that controls conditional inclusion shall be
an integral constant expression except that: it shall not
contain a cast; identifiers (including those lexically identical
to keywords) are interpreted as described below; [83] and it may
contain unary operator expressions of the form
defined identifier
or
defined ( identifer )
which evaluates to 1 if the idetnifier is currently defined
as a macro name (that is, if it is predefined or if it has
been the subject of a #define preprocessing directive without
intervening #undef directive with the same subject identifier),
0 if it is not.

[83] Because the controlling constant expression is evaluated
during translation phase 4, all identifiers either are or are
not macro names -- there simply are no keywords, enumeration
constants, and so on.


So you can put the word sizeof into a #if but it will be evaluated
strictly according to any macro definition that may have been
given for sizeof (and defining a macro with that name would
be a very poor design in any context I can think of at the moment.)
 
L

lawrence.jones

Doug said:
I'm looking
for a (preferrably electronic) copy of the C99 standard TC3 (I found
TC2 easily, TC3 seems to be hard to get at the moment unless I missed
it somehow).

said:
Further, although I know boards like this are great for getting
helpful advice about C, I was hoping to be directed to 'official'
discussions with minutes or similar (working groups, standards
committees, that sort of thing) for the sake of research and sourcing.

<http://www.open-std.org/jtc1/sc22/wg14/>

Also, the comp.std.c newsgroup is specifically for discussion about the
standard itself whereas comp.lang.c is for discussion of the language.

-Larry Jones

Well, it's all a question of perspective. -- Calvin
 
D

Doug

Excellent, thanks for the responses (and I didn't realise it was it
was a newsgroup, my mistake).

As for my mistakes in reading the standard, thanks a great deal! Its
very helpful to see were I read it wrong and I'll try not to make that
mistake again.

Doug
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top