|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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" |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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'. |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
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 |
|
![]() |
| Outils de la discussion | |
|
|