473,386 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Header file names

I have a header whose filename contains an embedded newline and I can't
seem to #include it successfully. I've tried

#include "my
file.h"

and

#include "my\nfile.h"

but neither works.

1. How can I achieve this?
2. Does the Standard limit the range of characters that can appear in
source file names? (for example, embedded tabs seem to be fine with an
actual tab character in the #include line)

Dec 2 '06 #1
31 2217
rb********@mailinator.com wrote:
I have a header whose filename contains an embedded newline and I can't
seem to #include it successfully. I've tried
So don't do it.

--
Ian Collins.
Dec 2 '06 #2
Well, that would be one solution... but it's not ideal - I'd like to
arrange my files according to my preferred conventions.

I think that #include "...\n..." doesn't work because the thing isn't a
string literal, but is interpreted by the preprocessor.

I really don't see why the preprocessor doesn't read a ", then look for
a closing ", then interpret everything in between (newlines or not) as
the filename. Is this just a problem with gcc's implementation, or does
the Standard actually allow compilers to place artifical restrictions
on the characters allowed in source file names? If so, why?

Ian Collins wrote:
rb********@mailinator.com wrote:
I have a header whose filename contains an embedded newline and I can't
seem to #include it successfully. I've tried
So don't do it.

--
Ian Collins.
Dec 2 '06 #3

chunks of the compiler that cares about line boundaries.
the preprocessor is line-oriented; it is one of the few
Section 6.4.7 paragraph 1. The likely reason is that
are forbidden in header names, as you will find in
Newlines

and also illustrates why top-posting is unpopular.
I hope this answer satisfies your curiosity,

rb********@mailinator.com wrote:
Well, that would be one solution... but it's not ideal - I'd like to
arrange my files according to my preferred conventions.

I think that #include "...\n..." doesn't work because the thing isn't a
string literal, but is interpreted by the preprocessor.

I really don't see why the preprocessor doesn't read a ", then look for
a closing ", then interpret everything in between (newlines or not) as
the filename. Is this just a problem with gcc's implementation, or does
the Standard actually allow compilers to place artifical restrictions
on the characters allowed in source file names? If so, why?

Ian Collins wrote:
>rb********@mailinator.com wrote:
>>I have a header whose filename contains an embedded newline and I can't
seem to #include it successfully. I've tried
So don't do it.

--
Ian Collins.
--
Eric Sosman
es*****@acm-dot-org.invalid
Dec 2 '06 #4
rb********@mailinator.com writes:
I have a header whose filename contains an embedded newline and I can't
seem to #include it successfully. I've tried

#include "my
file.h"

and

#include "my\nfile.h"

but neither works.

1. How can I achieve this?
2. Does the Standard limit the range of characters that can appear in
source file names? (for example, embedded tabs seem to be fine with an
actual tab character in the #include line)
For a directive of the form
#include "..."

the standard merely says that the sequence of characters between the
quotation marks (it's not really a string literal, though it looks
like one) "identifies" some source file. The manner in which it does
so is implementation-specific. Furthermore (C99 6.10.2p5):

The implementation shall provide unique mappings for sequences
consisting of one or more letters or digits (as defined in 5.2.1)
followed by a period (.) and a single letter. The first character
shall be a letter. The implementation may ignore the distinctions
of alphabetical case and restrict the mapping to eight significant
characters before the period.

There is no guarantee that all files can be specified by a #include
directive. In particular, I wouldn't be at all surprised if it were
impossible to refer to a file whose name contains a newline.

Why in the name of sanity would you want to have a header file with a
newline in its name in the first place?

--
Keith Thompson (The_Other_Keith) ks***@mib.org <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.
Dec 2 '06 #5
rb********@mailinator.com writes:
I really don't see why the preprocessor doesn't read a ", then look for
a closing ", then interpret everything in between (newlines or not) as
the filename. Is this just a problem with gcc's implementation, or does
the Standard actually allow compilers to place artifical restrictions
on the characters allowed in source file names? If so, why?
The Standard does allow compilers to interpret file names in
#include differently from string literals. One reason is that
some systems use backslash as a common character in file names.
--
"It would be a much better example of undefined behavior
if the behavior were undefined."
--Michael Rubenstein
Dec 2 '06 #6
rb********@mailinator.com writes:
Well, that would be one solution... but it's not ideal - I'd like to
arrange my files according to my preferred conventions.

I think that #include "...\n..." doesn't work because the thing isn't a
string literal, but is interpreted by the preprocessor.

I really don't see why the preprocessor doesn't read a ", then look for
a closing ", then interpret everything in between (newlines or not) as
the filename. Is this just a problem with gcc's implementation, or does
the Standard actually allow compilers to place artifical restrictions
on the characters allowed in source file names? If so, why?
Please don't top-post. Read the following:

http://www.caliburn.nl/topposting.html
http://www.cpax.org.uk/prg/writings/topposting.php

I've never even seen a file name with an embedded newline, except
perhaps one created by accident or to prove a point. Yes, compilers
are allowed to place artificial restrictions on the characters allowed
in source file names. See my other followup for more details.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <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.
Dec 2 '06 #7
Eric Sosman wrote:
chunks of the compiler that cares about line boundaries.
the preprocessor is line-oriented; it is one of the few
Section 6.4.7 paragraph 1. The likely reason is that
are forbidden in header names, as you will find in
Newlines
That reference seems to be broken - there's no subsection 6.4.7, and
section 6.4, "constant expressions", doesn't mention headers.
and also illustrates why top-posting is unpopular.
I hope this answer satisfies your curiosity,
Top-posting is nowhere near as confusing as rearranging the lines of
your message. I find it quite common (even the norm) in most email
conversations.

Dec 2 '06 #8
Keith Thompson wrote:
For a directive of the form
#include "..."

the standard merely says that the sequence of characters between the
quotation marks (it's not really a string literal, though it looks
like one) "identifies" some source file. The manner in which it does
so is implementation-specific.
Hmm, maybe I should file a bug/wishlist against gcc then.
Furthermore (C99 6.10.2p5):

The implementation shall provide unique mappings for sequences
consisting of one or more letters or digits (as defined in 5.2.1)
followed by a period (.) and a single letter. The first character
shall be a letter. The implementation may ignore the distinctions
of alphabetical case and restrict the mapping to eight significant
characters before the period.
That would seem to suggest it's impossible to directly give an absolute
path to a header file, which would start with / rather than a letter,
without using a command-line flag to the compiler or an environment
variable - odd! (For ref, I prefer the C90 standard - C99 seems like a
bit of a lame duck to me.)
Why in the name of sanity would you want to have a header file with a
newline in its name in the first place?
I have some legacy scripts for processing ls output that rely on
filenames being in the form
"projectname
filename"
I think that's quite a clear layout in any case.

Dec 2 '06 #9
rb********@mailinator.com wrote:
Eric Sosman wrote:
chunks of the compiler that cares about line boundaries.
the preprocessor is line-oriented; it is one of the few
Section 6.4.7 paragraph 1. The likely reason is that
are forbidden in header names, as you will find in
Newlines

That reference seems to be broken - there's no subsection 6.4.7, and
section 6.4, "constant expressions", doesn't mention headers.
6.4 Lexical elements
....
6.4.7 Header names
>
>and also illustrates why top-posting is unpopular.
I hope this answer satisfies your curiosity,

Top-posting is nowhere near as confusing as rearranging the lines of
your message. I find it quite common (even the norm) in most email
conversations.
Most users of e-mail are ignorant slaves to Outhouse Excess.
However, ignorance is curable.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
Dec 3 '06 #10
MQ

rb********@mailinator.com wrote:
I have a header whose filename contains an embedded newline and I can't
seem to #include it successfully. I've tried
Why on Earth would you want to persist with such an abomination? What
advantage is there to having a filename with an embedded newline?

MQ

Dec 3 '06 #11
rb********@mailinator.com writes:
Keith Thompson wrote:
[...]
>Furthermore (C99 6.10.2p5):

The implementation shall provide unique mappings for sequences
consisting of one or more letters or digits (as defined in 5.2.1)
followed by a period (.) and a single letter. The first character
shall be a letter. The implementation may ignore the distinctions
of alphabetical case and restrict the mapping to eight significant
characters before the period.

That would seem to suggest it's impossible to directly give an absolute
path to a header file, which would start with / rather than a letter,
without using a command-line flag to the compiler or an environment
variable - odd! (For ref, I prefer the C90 standard - C99 seems like a
bit of a lame duck to me.)
Not at all. It suggests that it's impossible to *portably* give an
absolute path. All implementations must support the limited form of
header names described in 6.10.2p5; most implementations support much
more than that.

An implementation for a system that doesn't use '/' as a directory
delimiter, for example, might not allow '/' in header names -- or it
might allow them and translate them to some system-specific form.
>Why in the name of sanity would you want to have a header file with a
newline in its name in the first place?

I have some legacy scripts for processing ls output that rely on
filenames being in the form
"projectname
filename"
I think that's quite a clear layout in any case.
Hmm. Personally I find that horrifying, but if it works for you
that's fine, and some systems do permit it.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <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.
Dec 3 '06 #12
rb********@mailinator.com wrote:
I have a header whose filename contains an embedded newline and I can't
seem to #include it successfully. I've tried

#include "my
file.h"

and

#include "my\nfile.h"

but neither works.

1. How can I achieve this?
2. Does the Standard limit the range of characters that can appear in
source file names? (for example, embedded tabs seem to be fine with an
actual tab character in the #include line)
Rename it?
Dec 3 '06 #13
rb********@mailinator.com wrote:
Eric Sosman wrote:
>chunks of the compiler that cares about line boundaries.
the preprocessor is line-oriented; it is one of the few
Section 6.4.7 paragraph 1. The likely reason is that
are forbidden in header names, as you will find in
Newlines

That reference seems to be broken - there's no subsection 6.4.7, and
section 6.4, "constant expressions", doesn't mention headers.
ISO/IEC 9899:1999 "Programming Languages -- C"
Section 6 "Language"
Section 6.4 "Lexical elements"
Section 6.4.7 "Header names"
Paragraph 1 (syntax description)

Appears on page number 64 (happy coincidence?), the 78th
page image in the document.

--
Eric Sosman
es*****@acm-dot-org.invalid

Dec 3 '06 #14
MQ wrote:
rb********@mailinator.com wrote:
>I have a header whose filename contains an embedded newline and I can't
seem to #include it successfully. I've tried

Why on Earth would you want to persist with such an abomination? What
advantage is there to having a filename with an embedded newline?
Hmmm... Perhaps it's not the "name" of the file, but
of a "directory" somewhere on its "path?"

X:\My Pet Projects\It was the best of times,
it was the worst of times, it was the age of
foolishness, it was the epoch of belief, it
was the epoch of incredulity\Cstuff\header.h

If the long directory name were not broken into multiple
lines with embedded newline characters, it might be found
unwieldy.

;-)

--
Eric Sosman
es*****@acm-dot-org.invalid
Dec 3 '06 #15
In article <11**********************@73g2000cwn.googlegroups. com>,
MQ <mi**************@gmail.comwrote:
>
rb********@mailinator.com wrote:
>I have a header whose filename contains an embedded newline and I can't
seem to #include it successfully. I've tried

Why on Earth would you want to persist with such an abomination? What
advantage is there to having a filename with an embedded newline?
While it is hard for you or me to imagine that this actually happened in
real life, you do pretty much have to take OP's word for it that it did.

Basically, the answer is: because that's the file's name.

Note the progression of "weird filenames" (the first part is taken from
the DOS/Windows world - may not be directly applicable to Unix or other
platforms):
1) In the beginning, there was 8.3 (and that was Good)
2) Then there was "long filenames".
3) Then there were filenames with embedded spaces and other
"funny" characters (like ' or ")
4) Then there were filenames with embedded newlines, etc.

The point is that, if you have a filesystem that allows this sort of
stuff, then the rest of your apparatus should support it. To not do so
is to invite disaster.

Dec 3 '06 #16
Keith Thompson wrote:
<snip>
I've never even seen a file name with an embedded newline, except
perhaps one created by accident or to prove a point.
Well I have, many-a-time. Not only that, but since (as far as I know)
un*x-ish systems allow anything but / and NUL characters in a filename,
I had the "pleasure" to see *s, ?s and whatnot in a filename, often
with problematic outcome - a file called "-rf" and shell expansion when
doing a "rm *" can do magic.

Don't underestimate the ignorance of software users =)
--
WYCIWYG - what you C is what you get

Dec 3 '06 #17
Eric Sosman wrote:
That reference seems to be broken - there's no subsection 6.4.7, and
section 6.4, "constant expressions", doesn't mention headers.

ISO/IEC 9899:1999 "Programming Languages -- C"
Section 6 "Language"
Section 6.4 "Lexical elements"
Section 6.4.7 "Header names"
Paragraph 1 (syntax description)
I see now - "the Standard" seems to mean "the C99 standard" in these
parts, rather than C90. Slightly depressing that such a monstrosity has
gained such currency - C90 was a thing of beauty, essentially perfect,
and the idea of polluting something so pure with // comments,
variable-length arrays and all the other junk is not a pleasing one :)

Dec 3 '06 #18
MQ

Eric Sosman wrote:
>
If the long directory name were not broken into multiple
lines with embedded newline characters, it might be found
unwieldy.
In which case you would have to ponder the purpose of having such long
directory names. And I have seen some awful filenames at a company I
worked at, who seemed to abuse the filename size limit just because
they could. For example, files like "Client - XXX, Job - YYY, Meeting
regarding ZZZ, 24th July 2003.doc". This from a customer service
consultant who didn't know how to create directories, or spell the word
"staple" (she spelt it "staibel"). I remember reading job notes and
wetting myself laughing at her spelling and grammar which in some cases
was so bad as to look like some sort of pidgin language.

MQ

Dec 4 '06 #19
rb********@mailinator.com said:

<snip>
I see now - "the Standard" seems to mean "the C99 standard" in these
parts, rather than C90.
It depends who you talk to. IMHO, yes, okay, C99 is the de jure standard,
but C90 remains the de facto standard for the time being, because hardly
any conforming C99 implementations exist. C99 effectively standardises
vapourware.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Dec 4 '06 #20
Richard Heathfield wrote:
rb********@mailinator.com said:

<snip>
>I see now - "the Standard" seems to mean "the C99 standard" in
these parts, rather than C90.

It depends who you talk to. IMHO, yes, okay, C99 is the de jure
standard, but C90 remains the de facto standard for the time
being, because hardly any conforming C99 implementations exist.
C99 effectively standardises vapourware.
In addition copies of the C99 standard are readily available, which
does not apply to the C90 standard.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
Dec 4 '06 #21
CBFalconer said:
Richard Heathfield wrote:
>rb********@mailinator.com said:

<snip>
>>I see now - "the Standard" seems to mean "the C99 standard" in
these parts, rather than C90.

It depends who you talk to. IMHO, yes, okay, C99 is the de jure
standard, but C90 remains the de facto standard for the time
being, because hardly any conforming C99 implementations exist.
C99 effectively standardises vapourware.

In addition copies of the C99 standard are readily available, which
does not apply to the C90 standard.
True (although you can get a C89 draft easily enough). But there's no great
advantage to having easy accessibility to a standard that hardly anyone has
implemented.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Dec 4 '06 #22
On Mon, 04 Dec 2006 07:48:25 +0000, in comp.lang.c , Richard
Heathfield <rj*@see.sig.invalidwrote:
>But there's no great
advantage to having easy accessibility to a standard that hardly anyone has
implemented.
Other, of course, than making sure your code is as future-proof as can
be reasonably expected.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Dec 4 '06 #23
Mark McIntyre said:
On Mon, 04 Dec 2006 07:48:25 +0000, in comp.lang.c , Richard
Heathfield <rj*@see.sig.invalidwrote:
>>But there's no great
advantage to having easy accessibility to a standard that hardly anyone
has implemented.

Other, of course, than making sure your code is as future-proof as can
be reasonably expected.
Good spot. Yes, okay, that's true. But *apart* from that, what have the
Romans ever done for us, eh?

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Dec 4 '06 #24
Mark McIntyre wrote:
Richard Heathfield <rj*@see.sig.invalidwrote:
>But there's no great advantage to having easy accessibility to a
standard that hardly anyone has implemented.

Other, of course, than making sure your code is as future-proof as
can be reasonably expected.
This is one of the few times I have to agree with Mark over
Richard. :-)

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
Dec 4 '06 #25
rb********@mailinator.com wrote:
Eric Sosman wrote:
>>That reference seems to be broken - there's no subsection 6.4.7, and
section 6.4, "constant expressions", doesn't mention headers.
ISO/IEC 9899:1999 "Programming Languages -- C"
Section 6 "Language"
Section 6.4 "Lexical elements"
Section 6.4.7 "Header names"
Paragraph 1 (syntax description)

I see now - "the Standard" seems to mean "the C99 standard" in these
parts, rather than C90. Slightly depressing that such a monstrosity has
gained such currency - C90 was a thing of beauty, essentially perfect,
and the idea of polluting something so pure with // comments,
variable-length arrays and all the other junk is not a pleasing one :)
There are some things in C99 whose usefulness eludes me,
but face it: ISO/IEC 9899:1999 (as amended) is the International
Standard. "Be not the first by whom the new is tried, nor yet
the last to lay the old aside."

As for the characters permitted in header names: The rule
is not new, not some kind of C99 invention. You will find the
same rule in Section 3.1.7 of the ANSI C Standard, vintage 1989.

--
Eric Sosman
es*****@acm-dot-org.invalid

Dec 4 '06 #26
Richard Heathfield wrote:
Mark McIntyre said:
>Richard Heathfield <rj*@see.sig.invalidwrote:
>>But there's no great advantage to having easy accessibility to
a standard that hardly anyone has implemented.

Other, of course, than making sure your code is as future-proof
as can be reasonably expected.

Good spot. Yes, okay, that's true. But *apart* from that, what
have the Romans ever done for us, eh?
Aren't you guys still using their baths, roads, and walls?

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
Dec 4 '06 #27
Eric Sosman wrote:
>
rb********@mailinator.com wrote:
Eric Sosman wrote:
>That reference seems to be broken - there's no subsection 6.4.7, and
section 6.4, "constant expressions", doesn't mention headers.
ISO/IEC 9899:1999 "Programming Languages -- C"
Section 6 "Language"
Section 6.4 "Lexical elements"
Section 6.4.7 "Header names"
Paragraph 1 (syntax description)
I see now - "the Standard" seems to mean "the C99 standard" in these
parts, rather than C90. Slightly depressing that such a monstrosity has
gained such currency - C90 was a thing of beauty, essentially perfect,
and the idea of polluting something so pure with // comments,
variable-length arrays and all the other junk is not a pleasing one :)

There are some things in C99 whose usefulness eludes me,
but face it: ISO/IEC 9899:1999 (as amended) is the International
Standard. "Be not the first by whom the new is tried, nor yet
the last to lay the old aside."

As for the characters permitted in header names: The rule
is not new, not some kind of C99 invention. You will find the
same rule in Section 3.1.7 of the ANSI C Standard, vintage 1989.
Header names are in 6.1.7 in my copy of ISO/IEC 9899: 1990.

--
pete
Dec 4 '06 #28
pete <pf*****@mindspring.comwrites:
Eric Sosman wrote:
[...]
> As for the characters permitted in header names: The rule
is not new, not some kind of C99 invention. You will find the
same rule in Section 3.1.7 of the ANSI C Standard, vintage 1989.

Header names are in 6.1.7 in my copy of ISO/IEC 9899: 1990.
Yes, one of the few differences between the 1989 ANSi standard and the
1990 ISO standard is that the latter adds some sections (or splits up
some existing sections?) in accordance with ISO rules. I think that
ANSI C89 3.X.Y always corresonds to ISO C90 6.X.Y, and it's probably
the same for 4 vs. 7.

(I don't think I've ever seen a copy of the actual 1989 ANSI C
standard. ANSI adopted the ISO standard shortly after it was issued;
presumably they stopped printing the older version at that time.)

--
Keith Thompson (The_Other_Keith) ks***@mib.org <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.
Dec 4 '06 #29
On Mon, 04 Dec 2006 08:05:26 -0500, in comp.lang.c , CBFalconer
<cb********@yahoo.comwrote:
>Richard Heathfield wrote:
>Mark McIntyre said:
>>Richard Heathfield <rj*@see.sig.invalidwrote:

But there's no great advantage to having easy accessibility to
a standard that hardly anyone has implemented.

Other, of course, than making sure your code is as future-proof
as can be reasonably expected.

Good spot. Yes, okay, that's true. But *apart* from that, what
have the Romans ever done for us, eh?

Aren't you guys still using their baths, roads, and walls?
er...

romani eunt domi.?
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Dec 4 '06 #30
pete wrote:
Eric Sosman wrote:
>rb********@mailinator.com wrote:
>>Eric Sosman wrote:
That reference seems to be broken - there's no subsection 6.4.7, and
section 6.4, "constant expressions", doesn't mention headers.
ISO/IEC 9899:1999 "Programming Languages -- C"
Section 6 "Language"
Section 6.4 "Lexical elements"
Section 6.4.7 "Header names"
Paragraph 1 (syntax description)
I see now - "the Standard" seems to mean "the C99 standard" in these
parts, rather than C90. Slightly depressing that such a monstrosity has
gained such currency - C90 was a thing of beauty, essentially perfect,
and the idea of polluting something so pure with // comments,
variable-length arrays and all the other junk is not a pleasing one :)
There are some things in C99 whose usefulness eludes me,
but face it: ISO/IEC 9899:1999 (as amended) is the International
Standard. "Be not the first by whom the new is tried, nor yet
the last to lay the old aside."

As for the characters permitted in header names: The rule
is not new, not some kind of C99 invention. You will find the
same rule in Section 3.1.7 of the ANSI C Standard, vintage 1989.

Header names are in 6.1.7 in my copy of ISO/IEC 9899: 1990.
I see now - "the Standard" seems to mean "the C90 standard"
in these parts, rather than ANSI. Slightly depressing that such
a monstrosity has gained such currency - ANSI was a thing of beauty,
essentially perfect, and the idea of wantonly renumbering all its
exquisite paragraphs and throwing out its non-normative elucidations
is not a pleasing one.

--
Eric Sosman
es*****@acm-dot-org.invalid
Dec 5 '06 #31
rb********@mailinator.com wrote:
Keith Thompson wrote:
Furthermore (C99 6.10.2p5):

The implementation shall provide unique mappings for sequences
consisting of one or more letters or digits (as defined in 5.2.1)
followed by a period (.) and a single letter. The first character
shall be a letter. The implementation may ignore the distinctions
of alphabetical case and restrict the mapping to eight significant
characters before the period.

That would seem to suggest it's impossible to directly give an absolute
path to a header file, which would start with / rather than a letter,
without using a command-line flag to the compiler or an environment
variable - odd!
Not at all. The implementation _shall_ provide mappings for any
ABCDEFGH.I style header name, but it _may_ accept any other name it
likes. And implementations commonly do. What it does mean is that
#include </this/is/a/path/header.his not portable; but that should be
no surprise, because path names themselves are not portable. Would you
expect #include <C:\Program Files\Woggo-C\Projects\Program\header.hto
work on a unixoid? Of course not. And similarly, a path starting with /
is not valid on a system which uses another directory separator. Your
unixy cc may accept it, but there's no reason for a mainframe compiler
to do so.
Why in the name of sanity would you want to have a header file with a
newline in its name in the first place?

I have some legacy scripts for processing ls output that rely on
filenames being in the form
"projectname
filename"
I think that's quite a clear layout in any case.
As a sysadmin as well as a programmer, my sincere reaction is: bleurgh.
Please stop messing with my directory listings. Fix your script, don't
spay your directories.

Richard
Dec 5 '06 #32

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

31
by: Steven T. Hatton | last post by:
If a header is not necessarily a source file, and the sequences delimited by < and > in header names aren't necessarily valid source file names, what exactly is a header? -- p->m == (*p).m == p.m...
16
by: matthurne | last post by:
I just started learning C++ on my own...I'm using Accelerated C++. Something it hasn't explained and I keep wondering about is how header files actually work. I suspect it doesn't get into it...
11
by: Steven T. Hatton | last post by:
In the past there have been lengthy discussiions regarding the role of header files in C++. People have been very adamat about header files serving as in interface to the implementation. I do...
18
by: Exits Funnel | last post by:
Hello, I'm a little confused about where I should include header files and was wondering whether there was some convention. Imagine I've written a class foo and put the definition in foo.h and...
60
by: Derrick Coetzee | last post by:
It seems like, in every C source file I've ever seen, there has been a very definite include order, as follows: - include system headers - include application headers - include the header...
5
by: cwc5w | last post by:
//x.cpp #include <h1> #include "h2" which directory will C++ first look for when including h1? h2? Thanks!
4
by: none | last post by:
Hi, I am wondering if anyone has some insight into a way to get the names of the functions that are defined in a C header file. What I am trying to do is develop tests for a large amount of C...
16
by: wdh3rd | last post by:
Hi everyone. I'm new to C and I have a few questions: I am making files for permutations and combinations. Files to be made are perm.c, perm.h, combo.c, and combo.h. Since both combinations...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.