public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Keeping blank lines in C++ preproccessor output
@ 2012-01-07  2:57 galexander2
  0 siblings, 0 replies; 4+ messages in thread
From: galexander2 @ 2012-01-07  2:57 UTC (permalink / raw)
  To: gcc-help

I'm using the C++ preprocessor (g++ -E) to partially preprocess a C++ header file.  The preprocessor output documentation (http://gcc.gnu.org/onlinedocs/gcc-4.5.1/cpp/Preprocessor-Output.html) states:

  Long runs of blank lines are discarded.

Rather than have long runs of blank lines discarded, I would prefer that runs of two or more blank lines be replaced by single blank line or that blank lines be left as is.  Does anyone know of a way to accomplish either of these?

Thanks,
Geoff Alexander

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

* Re: Keeping blank lines in C++ preproccessor output
  2012-01-08  1:02 ` Ian Lance Taylor
@ 2012-01-10 17:01   ` Kevin P. Fleming
  0 siblings, 0 replies; 4+ messages in thread
From: Kevin P. Fleming @ 2012-01-10 17:01 UTC (permalink / raw)
  To: gcc-help

On 01/07/2012 01:05 PM, Ian Lance Taylor wrote:
> <galexander2@nc.rr.com>  writes:
>
>> I'm using the C++ preprocessor (g++ -E) to partially preprocess a C++ header file.  The preprocessor output documentation (http://gcc.gnu.org/onlinedocs/gcc-4.6.2/cpp/Preprocessor-Output.html#Preprocessor-Output) states:
>>
>>    Long runs of blank lines are discarded.
>>
>> Rather than have long runs of blank lines discarded, I would prefer that runs of two or more blank lines be replaced by single blank line or be left as is.  Does anyone know of a way to accomplish either of these?
>
> As far as I know there is no way to do this (other than modifying the
> preprocessor code).  It would not be too hard to write a postprocessor
> which looked at the #line statements and recreated the blank lines.

You could also use MCPP if you wish to roll your own preprocessing tool 
with more control over the output.

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
Jabber: kfleming@digium.com | SIP: kpfleming@digium.com | Skype: kpfleming
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at www.digium.com & www.asterisk.org

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

* Re: Keeping blank lines in C++ preproccessor output
  2012-01-07  6:49 galexander2
@ 2012-01-08  1:02 ` Ian Lance Taylor
  2012-01-10 17:01   ` Kevin P. Fleming
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Lance Taylor @ 2012-01-08  1:02 UTC (permalink / raw)
  To: galexander2; +Cc: gcc-help

<galexander2@nc.rr.com> writes:

> I'm using the C++ preprocessor (g++ -E) to partially preprocess a C++ header file.  The preprocessor output documentation (http://gcc.gnu.org/onlinedocs/gcc-4.6.2/cpp/Preprocessor-Output.html#Preprocessor-Output) states:
>
>   Long runs of blank lines are discarded.
>
> Rather than have long runs of blank lines discarded, I would prefer that runs of two or more blank lines be replaced by single blank line or be left as is.  Does anyone know of a way to accomplish either of these?

As far as I know there is no way to do this (other than modifying the
preprocessor code).  It would not be too hard to write a postprocessor
which looked at the #line statements and recreated the blank lines.

Ian

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

* Keeping blank lines in C++ preproccessor output
@ 2012-01-07  6:49 galexander2
  2012-01-08  1:02 ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: galexander2 @ 2012-01-07  6:49 UTC (permalink / raw)
  To: gcc-help

I'm using the C++ preprocessor (g++ -E) to partially preprocess a C++ header file.  The preprocessor output documentation (http://gcc.gnu.org/onlinedocs/gcc-4.6.2/cpp/Preprocessor-Output.html#Preprocessor-Output) states:

  Long runs of blank lines are discarded.

Rather than have long runs of blank lines discarded, I would prefer that runs of two or more blank lines be replaced by single blank line or be left as is.  Does anyone know of a way to accomplish either of these?

Thanks,
Geoff Alexander

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

end of thread, other threads:[~2012-01-09 20:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-07  2:57 Keeping blank lines in C++ preproccessor output galexander2
2012-01-07  6:49 galexander2
2012-01-08  1:02 ` Ian Lance Taylor
2012-01-10 17:01   ` Kevin P. Fleming

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).