Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Perl: porters

[PATCH] Indented preproc directives in sv.c

 

 

Perl porters RSS feed   Index | Next | Previous | View Threaded


jdhedden at cpan

May 22, 2008, 6:46 AM

Post #1 of 4 (112 views)
Permalink
[PATCH] Indented preproc directives in sv.c

I noticed in Perl_sv_free that a couple of preprocessor directives are
not flush with the left margin:

#ifdef DEBUG_LEAKING_SCALARS_FORK_DUMP
Perl_dump_sv_child(aTHX_ sv);
#else
#ifdef DEBUG_LEAKING_SCALARS
sv_dump(sv);
#endif
#ifdef DEBUG_LEAKING_SCALARS_ABORT

This looks to be a bug. Is it? If so, the attached patch should fix it.
Attachments: patch.txt (0.36 KB)


h.m.brand at xs4all

May 22, 2008, 6:57 AM

Post #2 of 4 (104 views)
Permalink
Re: [PATCH] Indented preproc directives in sv.c [In reply to]

On Thu, 22 May 2008 09:46:13 -0400, "Jerry D. Hedden"
<jdhedden[at]cpan.org> wrote:

> I noticed in Perl_sv_free that a couple of preprocessor directives are
> not flush with the left margin:
>
> #ifdef DEBUG_LEAKING_SCALARS_FORK_DUMP
> Perl_dump_sv_child(aTHX_ sv);
> #else
> #ifdef DEBUG_LEAKING_SCALARS
> sv_dump(sv);
> #endif
> #ifdef DEBUG_LEAKING_SCALARS_ABORT
>
> This looks to be a bug. Is it? If so, the attached patch should fix it.

ANSI allows this. Some old AIX preprocessors might choke on it, but
that is the only cpp I've ever seen causing trouble

--
H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using & porting perl 5.6.2, 5.8.x, 5.10.x on HP-UX 10.20, 11.00, 11.11,
& 11.23, SuSE 10.1 & 10.2, AIX 5.2, and Cygwin. http://qa.perl.org
http://mirrors.develooper.com/hpux/ http://www.test-smoke.org
http://www.goldmark.org/jeff/stupid-disclaimers/


Robin.Barker at npl

May 22, 2008, 7:06 AM

Post #3 of 4 (104 views)
Permalink
RE: [PATCH] Indented preproc directives in sv.c [In reply to]

> > #ifdef DEBUG_LEAKING_SCALARS_FORK_DUMP
> > Perl_dump_sv_child(aTHX_ sv);
> > #else
> > #ifdef DEBUG_LEAKING_SCALARS
> > sv_dump(sv);
> > #endif
> > #ifdef DEBUG_LEAKING_SCALARS_ABORT
> >
> > This looks to be a bug. Is it? If so, the attached patch should fix it.
>
> ANSI allows this. Some old AIX preprocessors might choke on it, but
> that is the only cpp I've ever seen causing trouble

The usual approach in the perl sources is to indent the 'ifdef'
but leave the '#' in column 1. See <grep '^# *if' *.[ch]>.

Robin

-------------------------------------------------------------------
This e-mail and any attachments may contain confidential and/or
privileged material; it is for the intended addressee(s) only.
If you are not a named addressee, you must not use, retain or
disclose such information.

NPL Management Ltd cannot guarantee that the e-mail or any
attachments are free from viruses.

NPL Management Ltd. Registered in England and Wales. No: 2937881
Registered Office: Serco House, 16 Bartley Wood Business Park,
Hook, Hampshire, United Kingdom RG27 9UY
-------------------------------------------------------------------


doughera at lafayette

May 22, 2008, 7:38 AM

Post #4 of 4 (104 views)
Permalink
Re: [PATCH] Indented preproc directives in sv.c [In reply to]

On Thu, 22 May 2008, H.Merijn Brand wrote:

> On Thu, 22 May 2008 09:46:13 -0400, "Jerry D. Hedden"
> <jdhedden[at]cpan.org> wrote:
>
> > I noticed in Perl_sv_free that a couple of preprocessor directives are
> > not flush with the left margin:
> >
> > #ifdef DEBUG_LEAKING_SCALARS_FORK_DUMP
> > Perl_dump_sv_child(aTHX_ sv);
> > #else
> > #ifdef DEBUG_LEAKING_SCALARS
> > sv_dump(sv);
> > #endif
> > #ifdef DEBUG_LEAKING_SCALARS_ABORT
> >
> > This looks to be a bug. Is it? If so, the attached patch should fix it.
>
> ANSI allows this. Some old AIX preprocessors might choke on it, but
> that is the only cpp I've ever seen causing trouble

The typical practice in the perl sources is to indent after the '#'

#ifdef DEBUG_LEAKING_SCALARS_FORK_DUMP
Perl_dump_sv_child(aTHX_ sv);
#else
# ifdef DEBUG_LEAKING_SCALARS
sv_dump(sv);
# endif
#ifdef DEBUG_LEAKING_SCALARS_ABORT

--
Andy Dougherty doughera[at]lafayette.edu

Perl porters RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.