public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Kevin P. Fleming" <kpfleming@digium.com>
To: gcc-help@gcc.gnu.org
Subject: Re: Keeping blank lines in C++ preproccessor output
Date: Tue, 10 Jan 2012 17:01:00 -0000	[thread overview]
Message-ID: <4F0B5417.3040206@digium.com> (raw)
In-Reply-To: <mcrvcon2v0a.fsf@dhcp-172-18-216-180.mtv.corp.google.com>

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

  reply	other threads:[~2012-01-09 20:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-07  6:49 galexander2
2012-01-08  1:02 ` Ian Lance Taylor
2012-01-10 17:01   ` Kevin P. Fleming [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-01-07  2:57 galexander2

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F0B5417.3040206@digium.com \
    --to=kpfleming@digium.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).