Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > problem with compilation

Reply
Thread Tools

problem with compilation

 
 
pete
Guest
Posts: n/a
 
      03-23-2005
Tim Rentsch wrote:
>
> pete <(E-Mail Removed)> writes:
>
> > Tim Rentsch wrote:
> > >
> > > pete <(E-Mail Removed)> writes:
> > >
> > > > Each byte in a C program is one of 4 things:
> > > > 1 part of a comment
> > > > 2 part of a preprocessor directive
> > > > 3 part of an external declaration
> > > > 4 all other bytes in a C program are white space

> >
> > > glossing over ... possible declaration/definition distinctions

>
> ^^^^^^^^^^^^^^^^^ [snipped text restored]
>
> > N869
> > 6.9 External definitions
> > [#5] An external definition is an external declaration that
> > is also a definition of a function or an object.

>
> It's because I wanted to avoid the topic and not take a position on it
> that I used the phrase "glossing over", together with "possible".


But I wanted to provide references anyway.

--
pete
 
Reply With Quote
 
 
 
 
Tim Rentsch
Guest
Posts: n/a
 
      03-23-2005
pete <(E-Mail Removed)> writes:

> Tim Rentsch wrote:
> >
> > pete <(E-Mail Removed)> writes:
> >
> > > Tim Rentsch wrote:
> > > >
> > > > pete <(E-Mail Removed)> writes:
> > > >
> > > > > Each byte in a C program is one of 4 things:
> > > > > 1 part of a comment
> > > > > 2 part of a preprocessor directive
> > > > > 3 part of an external declaration
> > > > > 4 all other bytes in a C program are white space
> > > >
> > > > Mostly I agree with this (glossing over the discussions about 'static'
> > > > vs "external" and possible declaration/definition distinctions).
> > > >
> > > > But, wouldn't you agree that \ NEWLINE aren't exactly like
> > > > other white space?

>
> I'll admit that they get treated differently during translation
> but I don't see why that is relevant.
>
> > > > (And they certainly don't fall into the
> > > > other three categories.) I feel a little bit uneasy referring
> > > > to \ NEWLINE as "white space".
> > >
> > > N869
> > > 7.4.1.9 The isspace function
> > > Description
> > > [#2] The
> > > standard white-space characters are the following: space
> > > (' '), form feed ('\f'), new-line ('\n'), carriage return
> > > ('\r'), horizontal tab ('\t'), and vertical tab ('\v')

> >
> > It's clear that \ NEWLINE sequences are not intended as white-space
> > in the language of the stanard document.

>
> Here's the language of the standard document:
> N869
> 5.1.1.2 Translation phases
> 3.
> Whether each nonempty
> sequence of white-space characters other than new-line
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> is retained or replaced by one space character is
> implementation-defined.
>
> It sure looks likes the language of the standard considers
> newline, to be one of the white-space characters.
>
> It almost seems as though you're trying to say
> that a white-space character that gets treated differently
> from the other white-space characters during translation,
> shouldn't be considered a white-space character.


What I'm saying is, even though newline is a white-space character,
not all newlines in a program source have to be white-space.

The text cited above supports this statement -- a \ NEWLINE is not
replaced by a space during translation. For example

whi\
le

will turn into a 'while' keyword, not 'whi le'. See 5.1.1.2 p1#2. It
is only in 5.1.1.2 p1#3 (the containing paragraph of the text cited
above) that white-space is mentioned in the translation phases. Any
occurences of \ NEWLINE (not counting the disallowed case at the end
of the file) will have been deleted by that point, per 5.1.1.2 p1#2.

 
Reply With Quote
 
 
 
 
pete
Guest
Posts: n/a
 
      03-30-2005
Tim Rentsch wrote:

> > > > > pete <(E-Mail Removed)> writes:
> > > > >
> > > > > > Each byte in a C program is one of 4 things:


That might be better stated as "one or more, of only 4 things"

> > > > > > 1 part of a comment
> > > > > > 2 part of a preprocessor directive
> > > > > > 3 part of an external declaration
> > > > > > 4 all other bytes in a C program are white space


> whi\
> le


That is not a counter example to my original claim.
Right?

--
pete
 
Reply With Quote
 
Tim Rentsch
Guest
Posts: n/a
 
      04-01-2005
pete <(E-Mail Removed)> writes:

> Tim Rentsch wrote:
>
> > > > > > pete <(E-Mail Removed)> writes:
> > > > > >
> > > > > > > Each byte in a C program is one of 4 things:

>
> That might be better stated as "one or more, of only 4 things"
>
> > > > > > > 1 part of a comment
> > > > > > > 2 part of a preprocessor directive
> > > > > > > 3 part of an external declaration
> > > > > > > 4 all other bytes in a C program are white space

>
> > whi\
> > le

>
> That is not a counter example to my original claim.
> Right?


Oh, I think it is. The term "white space" is usually taken (in C) to
mean characters that can separate adjacent tokens. The \ NL here
doesn't do that. And the treatment of \ NL is discussed (in the C
standard document) as part of a different translation phase than
when "white space" is processed. So unless you're using the term
"white space" differently than how I'm used to seeing it, and also
differently than how it's used in the standard, the \ NL in the
text above seems not to fall in any of the four categories you
give.

Another example:

/\
* silly comment *\
/

It's true the \ NL's are textually within the comment, but I wouldn't
call them part of the comment. And certainly I wouldn't call them
white space.

I agree that the distinction is probably below threshold for most
people. Based on what I've seen in other postings of yours, however,
I would guess that you're one of the people who would notice the
distinction. So maybe you could think of it as me paying you a
compliment.


Oh, before I forget - I tried sending an email to you (on another
topic) at the email address <(E-Mail Removed)>, and it bounced.
Was that just a glitch, or did I miss something?
 
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
Compilation error with seperate compilation C__chp C++ 4 02-15-2008 03:57 PM
Compilation Problem with Quartus II V4.0 (a new joke ?) ELJ VHDL 2 02-25-2005 11:43 AM
Problem with runtime compilation of aspx files. Register Directive ignores Assembly Dan ASP .Net 3 06-14-2004 06:13 AM
Problem with embedded Tomcat and JSP compilation. bcassand Java 4 01-12-2004 12:38 PM
Java compilation problem - Caused by package access JSR Java 2 12-11-2003 03:16 AM



Advertisments