PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.c > C99 (TC3) and 'official' discussions.
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
C99 (TC3) and 'official' discussions.

Réponse
 
LinkBack Outils de la discussion
Vieux 04/02/2008, 16h45   #1
Doug
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut C99 (TC3) and 'official' discussions.

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 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
ful 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 or assistance rendered
Doug
  Réponse avec citation
Vieux 04/02/2008, 17h24   #2
Keith Thompson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: C99 (TC3) and 'official' discussions.

Doug <Doug1984@gmail.com> writes:
> 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 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/wg...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
> ful 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.)

--
Keith Thompson (The_Other_Keith) <kst-u@mib.org>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
  Réponse avec citation
Vieux 04/02/2008, 17h29   #3
Walter Roberson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: C99 (TC3) and 'official' discussions.

In article <08a9d2c9-ebe1-430a-a3f0-d3079a9db1b3@e23g2000prf.googlegroups.com>,
Doug <Doug1984@gmail.com> wrote:

>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.)
--
'Roberson' is my family name; my given name is 'Walter'.
  Réponse avec citation
Vieux 04/02/2008, 18h30   #4
lawrence.jones@siemens.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: C99 (TC3) and 'official' discussions.

Doug <Doug1984@gmail.com> wrote:
>
> 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).


<http://webstore.ansi.org/FindStandards.aspx?SearchString=9899&SearchOption= 0&PageNum=0>

> Further, although I know boards like this are great for getting
> ful 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
  Réponse avec citation
Vieux 04/02/2008, 20h00   #5
Doug
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: C99 (TC3) and 'official' discussions.

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 ful to see were I read it wrong and I'll try not to make that
mistake again.

Doug
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 07h25.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12344 seconds with 13 queries