RE: Line info causes GCC to bomb?

2007-08-20 Thread Dave Korn
On 19 August 2007 21:24, [EMAIL PROTECTED] wrote:

 I haven't seen this problem anywhere in the list archive, so
 here it is.
 
 This preprocessed input causes GCC (3.4.4) to segfault
 
   # 1 test.c 1
 
   int main () {
  return 0;
   }
 
 ... and this doesn't:
 
   # 1 test.c
   # 1 test.c 1
 
   int main () {
 return 0;
   }
 
 Am I missing something?

  Nope, I can reproduce it.  

  Was it you or gcc that generated that preprocessed file?  It obviously 
shouldn't crash, but it's a much higher priority if gcc itself generates 
invalid preprocessed output than if it gets confused by something you've 
hand-generated (or post-pre-processed!) yourself.

cheers,
  DaveK
-- 
Can't think of a witty .sigline today


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: Line info causes GCC to bomb?

2007-08-20 Thread Dave Korn
On 20 August 2007 10:54, g6522c wrote:

[  List Cc'd back in.  http://cygwin.com/acronyms#PPIOSPE, thanks!  ]

 This preprocessed input causes GCC (3.4.4) to segfault
 
   # 1 test.c 1
 
   int main () {
  return 0;
   }
 
 ... and this doesn't:
 
   # 1 test.c
   # 1 test.c 1
 
   int main () {
 return 0;
   }

 This is from a different front end that I've put together.  It's referred
 to in the sig line.  The line numbering is as documented - partially - in
 the cpp Texinfo manual.  The input seems to be valid for all other builds
 of GCC.   

  I can't find that syntax described in the documentation, can point me at it?

  I note that gcc doesn't generate code like your first form, it always does it 
the second way, which makes me think that the first #-directive, the one 
without the trailing number, acts as some kind of introducer or otherwise 
triggers some internal struct to be set up in cpp without which the second 
form, with the trailing number, is invalid.


cheers,
  DaveK
-- 
Can't think of a witty .sigline today


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: Line info causes GCC to bomb?

2007-08-20 Thread g6522c
-Original Message-
From: Dave Korn [EMAIL PROTECTED]
Sent: Aug 20, 2007 6:25 AM
To: [EMAIL PROTECTED]
Cc: cygwin@cygwin.com
Subject: RE: Line info causes GCC to bomb?

On 20 August 2007 10:54, g6522c wrote:

[  List Cc'd back in.  http://cygwin.com/acronyms#PPIOSPE, thanks!  ]

 This preprocessed input causes GCC (3.4.4) to segfault
 
   # 1 test.c 1
 
   int main () {
  return 0;
   }
 
 ... and this doesn't:
 
   # 1 test.c
   # 1 test.c 1
 
   int main () {
 return 0;
   }

 This is from a different front end that I've put together.  It's referred
 to in the sig line.  The line numbering is as documented - partially - in
 the cpp Texinfo manual.  The input seems to be valid for all other builds
 of GCC.   

  I can't find that syntax described in the documentation, can point me at it?

  I note that gcc doesn't generate code like your first form, it always does 
 it the second way, which makes me think that the first #-directive, the one 
 without the trailing number, acts as some kind of introducer or otherwise 
 triggers some internal struct to be set up in cpp without which the second 
 form, with the trailing number, is invalid.


cheers,
  DaveK

It's indexed in cpp.info under, linemarkers.  

The output from cpp also contains other directives between the first two line 
markers, as in the second form, although I haven't had the opportunity to look 
at the gcc source to determine their purpose, or what initialization gcc needs 
for its line numbering.  

If I can locate the relevant routines in gcc I might be able to provide a 
patch.  My own preprocessor already has the necessary compatibility fix, though 
untested, because my linux box is waiting for spare parts.

Thanks again,

Robert



Ctalk Project Home Page: http://ctalk-lang.sourceforge.net
Mailing List:  [EMAIL PROTECTED]


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Line info causes GCC to bomb?

2007-08-20 Thread Brian Dessent
[EMAIL PROTECTED] wrote:

 If I can locate the relevant routines in gcc I might be able to provide a 
 patch.  My 

I wouldn't spend too much effort on that.  It's fixed in 4.x, and the
3.x branches were closed a long time ago.  OTOH, it might be nice to
have this fixed in the Cygwin-distributed gcc; however since it seems to
be a rather esoteric corner case it's not a huge priority.

Brian

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: Line info causes GCC to bomb?

2007-08-20 Thread Dave Korn
On , Dave Korn dave.korn wrote:

[  Please try to snip rawquotes of email addresses from replies (or even
better, configure your mailer to snip em out), posting someone's address to
the list causes them to receive more spam. 
(http://cygwin.com/acronyms#PCYMTNQREAIYR)   ]

 This preprocessed input causes GCC (3.4.4) to segfault
 
   # 1 test.c 1
 
   int main () {
  return 0;
   }
 
 ... and this doesn't:
 
   # 1 test.c
   # 1 test.c 1
 
   int main () {
 return 0;
   }

  I can't find that syntax described in the documentation, can point me at
 it?

 It's indexed in cpp.info under, linemarkers.

  Ah, found it.  Heh, so it's not documented in the section about Line
control, it's implicitly documented in the output format section. 

 The output from cpp also contains other directives between the first two
 line markers, as in the second form, although I haven't had the opportunity
 to look at the gcc source to determine their purpose, or what
 initialization gcc needs for its line numbering.
 
 If I can locate the relevant routines in gcc I might be able to provide a
 patch.  My own preprocessor already has the necessary compatibility fix,
 though untested, because my linux box is waiting for spare parts.

  shrugsIt's an arguable case.  These pseudo-line-directives are part of
the internal interface between parts of the compiler and I think not really
intended for general consumption, even though it is described as an
extension.  Since the form with the file introducer is what gcc generates,
and is what is guaranteed to work across all versions, I think you should
treat this situation as if there is a documentation error in the cpp manual,
and that it's part of the spec that you need to have an introducer line
before any lines with flags.   

  As for the sources, that's gcc-3.4.4/gcc/cpp*.[ch] for the most part.

cheers,
  DaveK
--
Can't think of a witty .sigline today
On 20 August 2007 12:26, g6522c wrote:


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



RE: Line info causes GCC to bomb?

2007-08-20 Thread Dave Korn
On 20 August 2007 12:40, Brian Dessent wrote:

 g6522c wrote:
 
 If I can locate the relevant routines in gcc I might be able to provide a
 patch.  My 
 
 I wouldn't spend too much effort on that.  It's fixed in 4.x, and the
 3.x branches were closed a long time ago.  OTOH, it might be nice to
 have this fixed in the Cygwin-distributed gcc; however since it seems to
 be a rather esoteric corner case it's not a huge priority.

  It's not that likely that I'll spin any more cygwin 3.x releases, unless
there's huge demand for it or some bug crops up that impacts a lot of people
in everyday use, but please do Cc me if you generate any patch, because it
might just happen.


cheers,
  DaveK
-- 
Can't think of a witty .sigline today


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: Line info causes GCC to bomb?

2007-08-20 Thread g6522c
-Original Message-
From: Brian Dessent [EMAIL PROTECTED]
Sent: Aug 20, 2007 7:40 AM
To: cygwin@cygwin.com

I wouldn't spend too much effort on that.  It's fixed in 4.x, and the
3.x branches were closed a long time ago.  OTOH, it might be nice to
have this fixed in the Cygwin-distributed gcc; however since it seems to
be a rather esoteric corner case it's not a huge priority.

I mostly wanted to dutifully note the issue.  As I indicated, it's easy to work 
around for me, and if someone decides to upgrade the Cygwin package they might 
need to be aware of it.

Thanks again,

Robert



Ctalk Project Home Page: http://ctalk-lang.sourceforge.net
Mailing List:  [EMAIL PROTECTED]


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/