public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* line size on C sources files
@ 2000-03-28  5:19 BIONDI Philippe
  2000-03-28  5:25 ` Stephen Frost
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: BIONDI Philippe @ 2000-03-28  5:19 UTC (permalink / raw)
  To: gcc-help

Hi all,
Is there anywhere on earth a rule/specification/usage that say that a C
source file must not have any line that exceeds 255 characters ?
I remember when my TPascal 4 EDI complained about lines bigger than 128
characters, but I don't know any rule that limit this size (neither posix,
nor ansi..). Am I wrong ? 
Because if such rule exist, gcc cpp is wrong expanding macros on one
(sometimes very long) line, and my Ingres precompiler win the round.
If not, my convictions are right and esqlc is too badly coded ! (and I can
complain to CAI)

best regards, Phil.

--
Philippe Biondi
Systems administrator
Webmotion Inc.
http://www.webmotion.com
mailto:philippe.biondi@webmotion.com
Fax. (613) 260-9545

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: line size on C sources files
  2000-03-28  5:19 line size on C sources files BIONDI Philippe
@ 2000-03-28  5:25 ` Stephen Frost
  2000-03-28  5:36   ` BIONDI Philippe
  2000-04-01  0:00   ` Stephen Frost
  2000-03-28 15:14 ` Martin v. Loewis
  2000-04-01  0:00 ` BIONDI Philippe
  2 siblings, 2 replies; 14+ messages in thread
From: Stephen Frost @ 2000-03-28  5:25 UTC (permalink / raw)
  To: BIONDI Philippe; +Cc: gcc-help

On Tue, 28 Mar 2000, BIONDI Philippe wrote:

> Is there anywhere on earth a rule/specification/usage that say that a C
> source file must not have any line that exceeds 255 characters ?

	Not that I am aware of.  C has always (to my knowledge) completely
ignored whitespace.  gcc certainly doesn't appear to care.

> I remember when my TPascal 4 EDI complained about lines bigger than 128
> characters, but I don't know any rule that limit this size (neither posix,
> nor ansi..). Am I wrong ? 
> Because if such rule exist, gcc cpp is wrong expanding macros on one
> (sometimes very long) line, and my Ingres precompiler win the round.
> If not, my convictions are right and esqlc is too badly coded ! (and I can
> complain to CAI)

	Hrm, sounds like 'esqlc' is badly coded, yes, but I would question if
you actually *need* to have a 255+ line. :)

		Stephen

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: line size on C sources files
  2000-03-28  5:25 ` Stephen Frost
@ 2000-03-28  5:36   ` BIONDI Philippe
  2000-03-28  5:41     ` Stephen Frost
  2000-04-01  0:00     ` BIONDI Philippe
  2000-04-01  0:00   ` Stephen Frost
  1 sibling, 2 replies; 14+ messages in thread
From: BIONDI Philippe @ 2000-03-28  5:36 UTC (permalink / raw)
  To: Stephen Frost; +Cc: BIONDI Philippe, gcc-help

On Tue, 28 Mar 2000, Stephen Frost wrote:

> 	Hrm, sounds like 'esqlc' is badly coded, yes, but I would question if
> you actually *need* to have a 255+ line. :)
> 

What about me wanting to expand macros before using esqlc (to use some
macros in EXEC SQL sections) ? I don't control the size of my
auto-generated C-SQL code. The question is : is this C-SQL code valid ? 
You and I think it is. The answer of the support is "put backslashes".

(Well I must also say about the support that I spend 3 hours to explain
them the two first lines of my mail. But that is another story ! :))


--
Philippe Biondi
Systems administrator
Webmotion Inc.
http://www.webmotion.com
mailto:philippe.biondi@webmotion.com
Fax. (613) 260-9545

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: line size on C sources files
  2000-03-28  5:36   ` BIONDI Philippe
@ 2000-03-28  5:41     ` Stephen Frost
  2000-03-28  6:34       ` BIONDI Philippe
  2000-04-01  0:00       ` Stephen Frost
  2000-04-01  0:00     ` BIONDI Philippe
  1 sibling, 2 replies; 14+ messages in thread
From: Stephen Frost @ 2000-03-28  5:41 UTC (permalink / raw)
  To: BIONDI Philippe; +Cc: gcc-help

On Tue, 28 Mar 2000, BIONDI Philippe wrote:

> On Tue, 28 Mar 2000, Stephen Frost wrote:
> 
> > 	Hrm, sounds like 'esqlc' is badly coded, yes, but I would question if
> > you actually *need* to have a 255+ line. :)
> 
> What about me wanting to expand macros before using esqlc (to use some
> macros in EXEC SQL sections) ? I don't control the size of my
> auto-generated C-SQL code. The question is : is this C-SQL code valid ? 
> You and I think it is. The answer of the support is "put backslashes".

	Hmm, well, what is true for C may or may not be exactly true for
SQL.  It may be that SQL has some silly limit on the number of characters
a SQL command can be on a single line.  If that is the case, then I see
little to do about it but to just use the backslashes.

		Stephen

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: line size on C sources files
  2000-03-28  5:41     ` Stephen Frost
@ 2000-03-28  6:34       ` BIONDI Philippe
  2000-04-01  0:00         ` BIONDI Philippe
  2000-04-01  0:00       ` Stephen Frost
  1 sibling, 1 reply; 14+ messages in thread
From: BIONDI Philippe @ 2000-03-28  6:34 UTC (permalink / raw)
  To: Stephen Frost; +Cc: BIONDI Philippe, gcc-help

> > What about me wanting to expand macros before using esqlc (to use some
> > macros in EXEC SQL sections) ? I don't control the size of my
> > auto-generated C-SQL code. The question is : is this C-SQL code valid ? 
> > You and I think it is. The answer of the support is "put backslashes".
> 
> 	Hmm, well, what is true for C may or may not be exactly true for
> SQL.  It may be that SQL has some silly limit on the number of characters
> a SQL command can be on a single line.  If that is the case, then I see
> little to do about it but to just use the backslashes.

That is not a sufficient reason to trunc my C lines. I don't mind about
the sql ones (in which TAILLE_TAMPON becomes 25) but about C lines in
which errno becomes longer stuff, or CELL_VALUE(x,y) which expands to 
lines that break the 255 limit.

If the C code is correct, the esqlc is broken, and the solution of the
support is not a solution.

--
Philippe Biondi
Systems administrator
Webmotion Inc.
http://www.webmotion.com
mailto:philippe.biondi@webmotion.com
Fax. (613) 260-9545

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: line size on C sources files
  2000-03-28  5:19 line size on C sources files BIONDI Philippe
  2000-03-28  5:25 ` Stephen Frost
@ 2000-03-28 15:14 ` Martin v. Loewis
  2000-03-28 21:16   ` Bill C Riemers
  2000-04-01  0:00   ` Martin v. Loewis
  2000-04-01  0:00 ` BIONDI Philippe
  2 siblings, 2 replies; 14+ messages in thread
From: Martin v. Loewis @ 2000-03-28 15:14 UTC (permalink / raw)
  To: Philippe.BIONDI; +Cc: gcc-help

> Is there anywhere on earth a rule/specification/usage that say that a C
> source file must not have any line that exceeds 255 characters ?

There is no such rule, but there is a different rule saying that all
implementations of C can have arbitrary limits, as long as they are
documented as such. However, for a number of limits, minimum
acceptable implementation limits are given, in particular, as per
5.2.4.1 (of C99)

- 4095 characters in a logical source line

So if you have more characters than that in a line, an implementation
of standard C could reject it and still claim conformance to the C
standard. Of course, no implementation of C is *required* to reject
it, in fact, implementations are encouraged to avoid imposing fixed
translation limits whenever possible.

Please note that this number is from C99; it may have been lower in
C89.

Regards,
Martin

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: line size on C sources files
  2000-03-28 15:14 ` Martin v. Loewis
@ 2000-03-28 21:16   ` Bill C Riemers
  2000-04-01  0:00     ` Bill C Riemers
  2000-04-01  0:00   ` Martin v. Loewis
  1 sibling, 1 reply; 14+ messages in thread
From: Bill C Riemers @ 2000-03-28 21:16 UTC (permalink / raw)
  To: Martin v. Loewis; +Cc: Philippe.BIONDI, gcc-help

Of course, just because the language allows very long lines, does not mean
you should use them.  If for no other reasons than they make it very difficult
to read your code.  Even if you have automatic line wrapping in the editor
you view the code with, if you want to debug the code, the line numbers you
can specify in gdb or any other debugger won't reflect wrapping that is not
in the source code itself.

			Bill

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: line size on C sources files
  2000-03-28  5:36   ` BIONDI Philippe
  2000-03-28  5:41     ` Stephen Frost
@ 2000-04-01  0:00     ` BIONDI Philippe
  1 sibling, 0 replies; 14+ messages in thread
From: BIONDI Philippe @ 2000-04-01  0:00 UTC (permalink / raw)
  To: Stephen Frost; +Cc: BIONDI Philippe, gcc-help

On Tue, 28 Mar 2000, Stephen Frost wrote:

> 	Hrm, sounds like 'esqlc' is badly coded, yes, but I would question if
> you actually *need* to have a 255+ line. :)
> 

What about me wanting to expand macros before using esqlc (to use some
macros in EXEC SQL sections) ? I don't control the size of my
auto-generated C-SQL code. The question is : is this C-SQL code valid ? 
You and I think it is. The answer of the support is "put backslashes".

(Well I must also say about the support that I spend 3 hours to explain
them the two first lines of my mail. But that is another story ! :))


--
Philippe Biondi
Systems administrator
Webmotion Inc.
http://www.webmotion.com
mailto:philippe.biondi@webmotion.com
Fax. (613) 260-9545

^ permalink raw reply	[flat|nested] 14+ messages in thread

* line size on C sources files
  2000-03-28  5:19 line size on C sources files BIONDI Philippe
  2000-03-28  5:25 ` Stephen Frost
  2000-03-28 15:14 ` Martin v. Loewis
@ 2000-04-01  0:00 ` BIONDI Philippe
  2 siblings, 0 replies; 14+ messages in thread
From: BIONDI Philippe @ 2000-04-01  0:00 UTC (permalink / raw)
  To: gcc-help

Hi all,
Is there anywhere on earth a rule/specification/usage that say that a C
source file must not have any line that exceeds 255 characters ?
I remember when my TPascal 4 EDI complained about lines bigger than 128
characters, but I don't know any rule that limit this size (neither posix,
nor ansi..). Am I wrong ? 
Because if such rule exist, gcc cpp is wrong expanding macros on one
(sometimes very long) line, and my Ingres precompiler win the round.
If not, my convictions are right and esqlc is too badly coded ! (and I can
complain to CAI)

best regards, Phil.

--
Philippe Biondi
Systems administrator
Webmotion Inc.
http://www.webmotion.com
mailto:philippe.biondi@webmotion.com
Fax. (613) 260-9545

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: line size on C sources files
  2000-03-28  5:41     ` Stephen Frost
  2000-03-28  6:34       ` BIONDI Philippe
@ 2000-04-01  0:00       ` Stephen Frost
  1 sibling, 0 replies; 14+ messages in thread
From: Stephen Frost @ 2000-04-01  0:00 UTC (permalink / raw)
  To: BIONDI Philippe; +Cc: gcc-help

On Tue, 28 Mar 2000, BIONDI Philippe wrote:

> On Tue, 28 Mar 2000, Stephen Frost wrote:
> 
> > 	Hrm, sounds like 'esqlc' is badly coded, yes, but I would question if
> > you actually *need* to have a 255+ line. :)
> 
> What about me wanting to expand macros before using esqlc (to use some
> macros in EXEC SQL sections) ? I don't control the size of my
> auto-generated C-SQL code. The question is : is this C-SQL code valid ? 
> You and I think it is. The answer of the support is "put backslashes".

	Hmm, well, what is true for C may or may not be exactly true for
SQL.  It may be that SQL has some silly limit on the number of characters
a SQL command can be on a single line.  If that is the case, then I see
little to do about it but to just use the backslashes.

		Stephen

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: line size on C sources files
  2000-03-28 21:16   ` Bill C Riemers
@ 2000-04-01  0:00     ` Bill C Riemers
  0 siblings, 0 replies; 14+ messages in thread
From: Bill C Riemers @ 2000-04-01  0:00 UTC (permalink / raw)
  To: Martin v. Loewis; +Cc: Philippe.BIONDI, gcc-help

Of course, just because the language allows very long lines, does not mean
you should use them.  If for no other reasons than they make it very difficult
to read your code.  Even if you have automatic line wrapping in the editor
you view the code with, if you want to debug the code, the line numbers you
can specify in gdb or any other debugger won't reflect wrapping that is not
in the source code itself.

			Bill

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: line size on C sources files
  2000-03-28  6:34       ` BIONDI Philippe
@ 2000-04-01  0:00         ` BIONDI Philippe
  0 siblings, 0 replies; 14+ messages in thread
From: BIONDI Philippe @ 2000-04-01  0:00 UTC (permalink / raw)
  To: Stephen Frost; +Cc: BIONDI Philippe, gcc-help

> > What about me wanting to expand macros before using esqlc (to use some
> > macros in EXEC SQL sections) ? I don't control the size of my
> > auto-generated C-SQL code. The question is : is this C-SQL code valid ? 
> > You and I think it is. The answer of the support is "put backslashes".
> 
> 	Hmm, well, what is true for C may or may not be exactly true for
> SQL.  It may be that SQL has some silly limit on the number of characters
> a SQL command can be on a single line.  If that is the case, then I see
> little to do about it but to just use the backslashes.

That is not a sufficient reason to trunc my C lines. I don't mind about
the sql ones (in which TAILLE_TAMPON becomes 25) but about C lines in
which errno becomes longer stuff, or CELL_VALUE(x,y) which expands to 
lines that break the 255 limit.

If the C code is correct, the esqlc is broken, and the solution of the
support is not a solution.

--
Philippe Biondi
Systems administrator
Webmotion Inc.
http://www.webmotion.com
mailto:philippe.biondi@webmotion.com
Fax. (613) 260-9545

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: line size on C sources files
  2000-03-28 15:14 ` Martin v. Loewis
  2000-03-28 21:16   ` Bill C Riemers
@ 2000-04-01  0:00   ` Martin v. Loewis
  1 sibling, 0 replies; 14+ messages in thread
From: Martin v. Loewis @ 2000-04-01  0:00 UTC (permalink / raw)
  To: Philippe.BIONDI; +Cc: gcc-help

> Is there anywhere on earth a rule/specification/usage that say that a C
> source file must not have any line that exceeds 255 characters ?

There is no such rule, but there is a different rule saying that all
implementations of C can have arbitrary limits, as long as they are
documented as such. However, for a number of limits, minimum
acceptable implementation limits are given, in particular, as per
5.2.4.1 (of C99)

- 4095 characters in a logical source line

So if you have more characters than that in a line, an implementation
of standard C could reject it and still claim conformance to the C
standard. Of course, no implementation of C is *required* to reject
it, in fact, implementations are encouraged to avoid imposing fixed
translation limits whenever possible.

Please note that this number is from C99; it may have been lower in
C89.

Regards,
Martin

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: line size on C sources files
  2000-03-28  5:25 ` Stephen Frost
  2000-03-28  5:36   ` BIONDI Philippe
@ 2000-04-01  0:00   ` Stephen Frost
  1 sibling, 0 replies; 14+ messages in thread
From: Stephen Frost @ 2000-04-01  0:00 UTC (permalink / raw)
  To: BIONDI Philippe; +Cc: gcc-help

On Tue, 28 Mar 2000, BIONDI Philippe wrote:

> Is there anywhere on earth a rule/specification/usage that say that a C
> source file must not have any line that exceeds 255 characters ?

	Not that I am aware of.  C has always (to my knowledge) completely
ignored whitespace.  gcc certainly doesn't appear to care.

> I remember when my TPascal 4 EDI complained about lines bigger than 128
> characters, but I don't know any rule that limit this size (neither posix,
> nor ansi..). Am I wrong ? 
> Because if such rule exist, gcc cpp is wrong expanding macros on one
> (sometimes very long) line, and my Ingres precompiler win the round.
> If not, my convictions are right and esqlc is too badly coded ! (and I can
> complain to CAI)

	Hrm, sounds like 'esqlc' is badly coded, yes, but I would question if
you actually *need* to have a 255+ line. :)

		Stephen

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2000-04-01  0:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-28  5:19 line size on C sources files BIONDI Philippe
2000-03-28  5:25 ` Stephen Frost
2000-03-28  5:36   ` BIONDI Philippe
2000-03-28  5:41     ` Stephen Frost
2000-03-28  6:34       ` BIONDI Philippe
2000-04-01  0:00         ` BIONDI Philippe
2000-04-01  0:00       ` Stephen Frost
2000-04-01  0:00     ` BIONDI Philippe
2000-04-01  0:00   ` Stephen Frost
2000-03-28 15:14 ` Martin v. Loewis
2000-03-28 21:16   ` Bill C Riemers
2000-04-01  0:00     ` Bill C Riemers
2000-04-01  0:00   ` Martin v. Loewis
2000-04-01  0:00 ` BIONDI Philippe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).