develooper Front page | perl.perl5.porters | Postings from July 2013

[perl #116296] [PATCH] remove PL_patchlevel from and optimize S_minus_v

Thread Previous
From:
bulk88 via RT
Date:
July 18, 2013 22:14
Subject:
[perl #116296] [PATCH] remove PL_patchlevel from and optimize S_minus_v
Message ID:
rt-3.6.HEAD-2552-1374185667-1477.116296-15-0@perl.org
On Thu Jul 18 12:35:21 2013, nicholas wrote:
> On Thu, Jul 18, 2013 at 11:57:37AM -0700, bulk88 via RT wrote:
> > Patch remade, newSVpvn and %d replaced with %zu to hopefully (not
> using
> > GCC) stop type mismatch warning.
> 
> I'm not sure if everything likes %zu. Particularly older SysV vendor
> compilers.
> Need to check.

OS C library is irrelevant. The format string is parsed by Perl itself
(Perl_sv_vcatpvfn_flags).

> 
> > With the copyright lines, use more CPP cating. This reduced the
> number of
> > instructions, and removes a couple alignment null in .rdata image
> section.
> 
> I'm pretty sure that mixing #ifdef and pre-processor string
> concatenation
> has upset some compilers in the past. Whilst no particular system is
> going to
> have more than one macro defined:

The current preproc conditional code could in theory allow 2 different
OSes to match and both of their strings are included. I think I above
asked whether to #elsif the OS lines but got no comments. In my original
patch I made only 1 OS line to be picked. To reduce controversy, I
reverted it back to the original/current 1 or more OS lines code.

> 
> >  #ifdef OEMVS
> > -	PerlIO_printf(PIO_stdout,
> > -		      "MVS (OS390) port by Mortice Kern Systems, 1997-1999\n");
> > +		      "MVS (OS390) port by Mortice Kern Systems, 1997-1999\n"
> >  #endif
> >  #ifdef __VOS__
> > -	PerlIO_printf(PIO_stdout,
> > -		      "Stratus OpenVOS port by Paul.Green@stratus.com, 1997-
> 2013\n");
> > +		      "Stratus OpenVOS port by Paul.Green@stratus.com, 1997-
> 2013\n"
> >  #endif
> >  #ifdef POSIX_BC
> > -	PerlIO_printf(PIO_stdout,
> > -		      "BS2000 (POSIX) port by Start Amadeus GmbH, 1998-1999\n");
> > +		      "BS2000 (POSIX) port by Start Amadeus GmbH, 1998-1999\n"
> > +#endif
> 
> the construction looks like it could cause compilers to choke
> (So we need to check before changing this)
> 
> Also, what's the maximum length from concatenating string literals
> doing it
> this way? IIRC ANSI's minimum limit was something puny like 502
> characters.
> I don't think that any compiler we encountered was that unforgiving,
> but
> something (IBM's compiler) maxed out at about 2000 characters, which
> we hit
> at times.
> 
> Nicholas Clark
> 

larry wall copy right+gpl string came out to 411 bytes+alignment padding
(upto 8 more bytes) in my Win32 binary image using a disassembler.

If CPP token catting doesn't work, I dont think Perl will compile
because of code like 

		Perl_croak(aTHX_
			   "Can't locate object method \"%"UTF8f
			   "\" via package \"%"SVf"\""
			   " (perhaps you forgot to load \"%"SVf"\"?)",

ifdefs evaled before string litteral catting,
http://stackoverflow.com/questions/1476892/poster-with-the-8-phases-of-translation-in-the-c-language

-- 
bulk88 ~ bulk88 at hotmail.com

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=116296

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About