't shut off to new tickets.
(Quite why the RT queue is allowing new tickets, I don't know, but I would
hope that perlbug-ad...@perl.org does, and can fix it)
Nicholas Clark
being able to have const pointers as variables
or in structs, and any assignments to pointers silently casting away const.
Nicholas Clark
2)
Eh? -1/2 is 0 for signed integer arithmetic.
> > #define MIN_INTVAL ((~MAX_INTVAL) + 1)
Even with the correct definition of MAX_INTVAL, that's going to be out by 1.
For a two's complement system, it doesn't need the + 1.
The logic that Perl 5 uses to do this is described here:
http://perl5.git.perl.org/perl.git/blob/HEAD:/perl.h#l2178
I suspect it's portable.
Nicholas Clark
r Inf?" is val != val * 0;
Then, NaN is val != val, +Inf is val > 0, -Inf is val < 0;
Nicholas Clark
and gcc may well take advantage of the (honest, validated) attribute_nonnulls
to optimiser better.
Well, it all works as long as the test coverage is good enough.
We've not had any further problems with them in Perl 5 since I added assertions
and fixed all the errors they found.
Nicholas Clark
t; +disappeared)
This? http://download.icu-project.org/ex/files/decNumber/decNumber-icu-361.zip
The prominent page has gone, but it seems to be referenced here still:
http://secure.alphaworks.ibm.com/tech/decnumber
Nicholas Clark
piler find them.
What you don't see in *that* change was the half dozen or so that it found
and I fixed, that I committed before I was able to add that. See here:
http://public.activestate.com/cgi-bin/perlbrowse?top=33291&show_recent=Show+Change+Log
Nicholas Clark
se in point is
> # Intel's C compiler, icc) and hence the #defined CONST_STRING
> # won't be found by the compiler.
Shouldn't there be a coding standard to enforce *that*?
Nicholas Clark
l foul of Algorithmic
Complexity attacks: http://www.cs.rice.edu/~scrosby/hash/
> Any mathematician is welcome to prove that this makes things worse, however.
Scott A Crosby and Dan S Wallach appear to be computer scientists. Will they
do? :-)
Nicholas Clark
t sure how portable fabsl() is either, though it may not matter.
> I don't see any harm to just omitting it here.)
Me neither. Surely
if (0.0 != -0.0) {
fputs("Your compiler is broken!", stderr);
}
(not tested. Particularly, not tested on icc with the "optimiser" enabled)
Nicholas Clark
although RedHat
managed to fix quite a few bugs in their later releases of it.
I was dis-inclined to support it even when it was brand new, because it was
buggy as hell, and because it was an upstart vendor manouver completely
counter to what the authors of the software wanted.
But in the end, the real victims of corporate stupidity are the users :-(
Nicholas Clark
;s probably a bit more than you need. :-)
> in OpenSolaris, we could keep the dependency on 5.8.1 (or whatever) and
> increase the Storable dependency to 2.18.
I infer from the quoted message above that bumping the dependency to 2.13
would work as well, but wouldn't cause a lot of other people who have 2.13
to 2.17 installed to need to upgrade.
Nicholas Clark
from machines that are not case
sensitive. You just can't know.
Nicholas Clark
out how to make the
> pmc2c data structures more compatible, so the older versions of Storable can
> serialize them properly.
Storable is dual life, so you could just depend on the version of Storable in
5.8.4 (2.12, I think). That way, anyone with an earlier Perl need only upgrade
Storable.
Nicholas Clark
mp;& scale)) {
>
> It's not *exactly* that. The first version executes
> emit_is8bit(disp), while the second one doesn't.
>
> You're correct that the return value of emit_is8bit(disp)
> doesn't appear to matter to the C statement itself.
So shouldn't it be re-written as
if (!base && !(i && scale)) {
emit_is8bit(disp);
?
Nicholas Clark
nicely. It catches all
all wrongness, not just explicit NULL calls.
Nicholas Clark
ot_string_t, bufused) == sizeof(Buffer)
matters, then something is either looking at or copying (sub)structures than
happen to have padding, and in turn that padding happens to end up with bit
patterns that have meaning in some other, larger (containing?) structure.
Nicholas Clark
gard them as potential land mines (or time bombs),
as perfectly working source code that compiles, makes test everywhere, and
is released (and distributed the world over) suddenly could stop working some
years in the future when someone compiles it on a compiler with optimisations
not available currently.
Nicholas Clark
On Sat, Jan 05, 2008 at 12:19:14PM -0600, Patrick R. Michaud wrote:
> On Sat, Jan 05, 2008 at 11:09:57AM +0000, Nicholas Clark wrote:
> > On Sat, Jan 05, 2008 at 02:11:35AM -0800, chromatic wrote:
> > Jarkko's view was that if he were doing Perl 5 Unicode again he would op
UCS-2 - if you would have
needed surrogate pairs, switch to UTF-32)
Everything is still fixed width, with linear access times.
Nicholas Clark
er
> >shuffling and macro madness?
>
> memmove fixes it. i submitted a patch, but for some reason it hasn't made
> it to RT or the list...
Do the structures actually overlap, or is this necessary band aid for a subtly
broken compiler?
Nicholas Clark
7;t be const.
> Andy: Go on, tell me.
> Andy: You can't.
>
> particle: of course i can't
> particle: in accessors, self should be constant
The equivalent would break in Perl 5, where the "objects" can change internal
private state as a side effect of being read. For example, conversions are
cached.
Nicholas Clark
lot about C, pointer aliasing rules are the big
thing I still don't feel confident about. I've very rarely seen them
covered.
Is there a good explanation anywhere online?
Nicholas Clark
believe is identical, even in the face of NaNs, but should also shut
up the whining, er, warning, about comparison.
Because I would be so bold as to say that the constant zero would be
exempted from any useful warning about floating point equality check.
Nicholas Clark
:) Are you still getting
> warnings on sparc?
I don't have access to the machine currently. (It's turned off)
I'll report a new bug if I regain access and get an opportunity to retest.
Nicholas Clark
g that
gcc does continues to endear it to me.
Nicholas Clark
SO/IEC 9899:1990 (``ISO C90'').
Nicholas Clark
library's index() doesn't always work. However,
> it's
> a good place to start as it tends to run much faster than the inchworm code
> here.
Would memchr() be of help here?
Nicholas Clark
On Thu, Sep 20, 2007 at 02:13:11PM -0700, chromatic wrote:
> Hoist that declaration up a bit, or C89 compilers will complain. Is there a
> GCC warning that we could enable here?
-Wdeclaration-after-statement
Sadly it can't be made an error.
Nicholas Clark
Even if the success object (the common case) is a singleton?
Implementation wise, is returning another reference to a singleton just one
C pointer copy?
(In which case, there is too much of a hit on interrogating the object?)
Nicholas Clark
;
>
> This patch implements the sign function for I, N, BigInt and Complex
> numbers.
What should the sign of a NaN be? undef?
Nicholas Clark
On Wed, Aug 22, 2007 at 05:40:45PM +0200, Paul Cochrane wrote:
> > We can leave it out, but then we'll never be able to compile Parrot with
> > Solaris CC.
>
> I just tried to compile Parrot with suncc and everything works (the
CC isn't cc
(C++ compiler versus C compiler)
Nicholas Clark
lt;= 0.0
which I believe is identical, even in the face of NaNs.
Nicholas Clark
l both have problems)
For most machines both assumptions are valid. But it's possible to build Perl
5 in configurations where it's not valid. For example, long doubles on Sparc
Solaris (and IIRC OS X on x86, surprisingly) are 16 bytes. long doubles on
most IEEE platforms would be even more fun (12 bytes, where actually only 10
are significant, and 2 are noise)
I can't think of a clean, portable, efficient way to test that a floating
point variable is zero other than == 0.0;
Nicholas Clark
> runops_args");
> }
>
> The string is only copied after this check is made.
So shouldn't that 8 be sizeof(new_sig) - 1 ?
Right now there are two magic numbers, one of which is actually off by one,
and no clear linking of the two.
Nicholas Clark
intf(interp, "%c", *(c++));
> > }
>
> That's an improvement, but *can* c actually be NULL here?
Well, it could be all bits zero if pdb->file->source is NULL and
line->source_offset, but that would be binary-identical-to-NULL-by-coincidence
rather than really NULL.
Without seeing any more than the code above, I'd guess that that's what the
Coverity tool actually triggered on, and so the question is should the guard
be on pdb->file->source ?
Nicholas Clark
of the get() call earlier on. In either case, the
> evaluation of the last statement and, hence, the return value of the
> subroutine was overwhelmingly likely to be a true value.
Or alternatively the value of something in the for() statement. IIRC it's
undefined (or at least not yet defined) whether a control statements such
as for() and if() count as 'last statement evaluated' for this purpose.
I'd definitely support adding an explicit return in this function. Just
ensure that it gets the right value as its argument.
Nicholas Clark
On Sun, Jul 08, 2007 at 10:07:34PM +, [EMAIL PROTECTED] wrote:
> It seems to run correctly on gentoo running on a sparc.
Is gentoo sparc an architecture with 64 bit pointers (and longs)?
Nicholas Clark
> >>>Modified since when?
Since the last time the user ran Configure.
(For the default test run)
I think that this will produce minimal false positives and false negatives,
for identifying which files have been locally edited.
Nicholas Clark
On Fri, Nov 07, 2008 at 03:28:40PM -0700, chromatic wrote:
> On Friday 22 June 2007 02:07:32 Nicholas Clark wrote:
>
> > > We have a lot of string_from_cstring() calls with constant second
> > > parameters and third parameters of 0 that could use updating. There
gs are accepted as
argument */
#define STR_WITH_LEN(s) (s ""), (sizeof(s)-1)
/* STR_WITH_LEN() shortcuts */
#define newSVpvs(str) Perl_newSVpvn(aTHX_ STR_WITH_LEN(str))
...
(Credit to chip for the concatenating with "" trick)
Nicholas Clark
lost in the noise.
Or better yet, lose it by using ccache.
> On the other hand, will #pragma once allow us to get rid of all of
> those ugly header guard macros? If so, I would argue to keep it for
> maintenance reasons, regardless of any performance benefits.
No, because you cannot rely on it working.
Nicholas Clark
nasal daemons, or something
similarly painful, on Irix64, until we removed assumptions about signed
integer overflow. (It's undefined behaviour. It will bite))
Nicholas Clark
Works for me! :-)
Thanks.
Nicholas Clark
ibparrot$(SHARE_EXT).$(SOVERSION)',
> +sym_export => '__attribute__ ((visibility("default")))',
> );
>
> if ( ( split( '-', $Config{archname} ) )[0] eq 'ia64' ) {
This is something I really approve of, but it can't be done unconditionally.
Is the gcc version kept somewhere convenient in the configure data structures?
Nicholas Clark
> of a function, not within any block.
They wouldn't be C89 conformant if they forbid *that*.
It may be something to do with the const *char const, what type "" string
constants have (according to the particular compiler) and how fussy it is.
And we found bugs in (at least) Borland's compiler to do with this sort of
thing.
Nicholas Clark
at performs locking?
And how often does the type of a PMC change, such that its internal data layout
changes? In Perl 5 this morphing happens everywhere, but in Parrot?
Nicholas Clark
s no
issues that prevent it from being complied with a seriously fastidious
compiler on a platform where the system headers are also suitably compliant.
Surprisingly Solaris is not such a platform. [Solaris is very carefully
engineered in so many other ways, that I had expected that it would be]
Nicholas Clark
One deserves to die.
Nicholas Clark
more complex is passed in. So, in general, I'd be happier with:
#define na(c) { \
while (*(c) && !isspace((int) *(c))) \
(c)++; \
while (isspace((int) *(c))) \
(c)++; }
Nicholas Clark
ut;
const void *in;
} launder;
You assign to in, then read from out. Et voila, you launder the const away.
Nicholas Clark
On Thu, May 10, 2007 at 03:33:41AM -0500, Joshua Isom wrote:
>
> On May 9, 2007, at 4:01 PM, Nicholas Clark wrote:
> >So, !s->strlen does scan as quickly and easily.
> >
>
> To some, but it isn't as easy to just literally read. "Not s's strlen&qu
On Wed, May 09, 2007 at 01:06:49PM -0700, chromatic wrote:
> On Wednesday 09 May 2007 12:53:57 Nicholas Clark wrote:
>
> > On Tue, May 01, 2007 at 04:41:22PM -0700, [EMAIL PROTECTED] wrote:
> > > +
> > > +#define STRING_IS_NULL(s) ((s) == NULL)
> > > +#defi
d? If so, its it
a better idea to abolish them and replace with one macro
STRING_IS_NULL_OR_EMPTY() ?
Although, visually it's distracting, and it's still about as much typing as
the macros' contents.
Nicholas Clark
y it should be exempt from coding standards.
Also, did it have any local modifications?
And why does Parrot needs its own malloc?
Nicholas Clark
would check whether the target exists
first, and skip until a target does not.
However, having a make like utility is easier. Lua seems to go for that
approach.
Nicholas Clark
thing very basic that can run a PBC).
> Whoa. I meant, have some kinda miniparrot that can run a PBC but is pure
> ANSI C or something. Long day...
I like this approach. It feels viable.
Nicholas Clark
On Wed, Apr 25, 2007 at 03:32:54PM +, Herbert Snorrason wrote:
> On 25.4.2007, at 15:06, Nicholas Clark wrote:
> >So Parrot is the odd one out here, for relying on an external
> >language for
> >its extended build process. I'm not sure if this is significa
ere, for relying on an external language for
its extended build process. I'm not sure if this is significant.
Nicholas Clark
On Tue, Apr 24, 2007 at 11:43:48PM -0700, Joshua Juran wrote:
> Parrot is also widely portable, much like perl is. This one's
> especially important to me, as I still work with Mac OS 9.
Parrot builds on Mac OS 9? Cool
It's not listed in PLATFORMS, so I wasn't sure.
Nicholas Clark
gt; are not there?
nan == nan isn't true, so that ought to be a portable test for a NaN
(although Intel's compiler's default optimisation setting is buggy in this
respect)
I don't know of a good way to test for inf.
Nicholas Clark
On Thu, Apr 12, 2007 at 01:50:09PM -0500, Joshua Isom wrote:
>
> On Apr 12, 2007, at 9:29 AM, Nicholas Clark wrote:
> My view of this is something along these lines. You can use any
> function you want at all, but if it's not documented as part of the
> supported API, ther
about
> > working more towards ANSI and POSIX compliance.
>
> I think that the same effect can be achieved using a linker script (although
> I don't know much about them), in wich case you are not depending on a
> compiler feature.
I thought the same, but I've never seen clear documentation as to how to do it.
Nicholas Clark
rly given that on some platforms (such as Win32) API functions need
to be exported explicitly, resulting in modules written on *nix platforms
not working on Win32.
(and actually, I'm tempted to add it even now to Perl 5 to enforce what
remains of our sanity)
Nicholas Clark
On Fri, Apr 06, 2007 at 11:55:49AM -0700, jerry gay wrote:
> On 4/6/07, Nicholas Clark <[EMAIL PROTECTED]> wrote:
> >If it's a crash in S_regmatch that's usually due to a regular expression
> >going exponential and exhausting the C stack. In turn, that's us
ter.
It's not allowed under (strict) ANSI C (and therefore those picky compilers)
So that NULLfunc is correct. But personally I prefer assigning plain 0.
Nicholas Clark
tten (to the point of buggy) regexp in the pod checker.
Not that that really helps track it down.
Nicholas Clark
ion cycle?
Well, it seems to be unused anywhere that Google's tentacles reach to:
http://www.google.com/codesearch?q=become_parent
Nicholas Clark
#x27;t -1. Or at least what
you thought was -1 isn't -1 any more, because it was converted to unsigned,
and then converted to a larger unsigned type, and so is now an unremarkable
positive integer, rather than all bits set.
Nicholas Clark
e information out)
I assume that in the position of maintaining Parrot I'd like the same
information about whether the release is vanilla and unmolested when I
got a bug report.
Nicholas Clark
g long.
My hunch is that commas at the end of enumerated lists is likely to be
something that will hinder portability, whereas the world is resigned to
long long.
[I say resigned, because "long long" breaches one of the axioms of C89, that
"long" is the longest integer type]
Nicholas Clark
ur smoke system
Most Perl 5 smoke systems report the bad tidings of black smoke to
perl5-porters. I've never noticed a failing Parrot smoke report to this list,
so I infer that they aren't set up this way. Would changing that help focus
minds?
> and i'm not inte
es me. Solaris is usually very clean and well engineered throughout)
Can Intel or Sun's compilers be coaxed into being suitably grumpy about this?
If so, do we have a machine capable of smoking them?
And is it viable (or good) for parrot smoke failures to reach this list, much
like most people configure their Perl 5 smokers to send the black smoke to
p5p?
Nicholas Clark
tal error?
Nicholas Clark
}
being a fairly good minimal example. I think that it's legal C++ too.
IIRC
main;
was found to be the shortest portable crash. :-)
Nicholas Clark
faster than the loop without strchr probably depends on whether
the compiler inlines strchr(), whether the optimised version is efficient
on non-word aligned strings, and whether the optimised version doesn't have
a higher start cost. Either is better* than the current, and I don't ha
x27;ll apply
> this tonight if no other Win32ers beat me to it. :-)
I don't disagree with that longer term plan.
On that subject, I remember 10 years ago so so, network drives on MS DOS named
ux: and uy:
Are 2 letter drive names still valid? Do they confuse most code?
Nicholas Clark
he e-mail address is clearly advertised.
But this isn't my call here.
Nicholas Clark
er. (Or, immediately copied to a machine that does have
outgoing mail enabled, or won't reveal your work e-mail address, or whatever)
Nicholas Clark
are ordered the Perl 5 way, they flatly contradict
the guarantee of C3.
It might be that I'm confused, misremembering or undercaffeinated.
Nicholas Clark
every type ending _t, but it seems that few pay
attention to that either.
Nicholas Clark
#x27;s
> too complicated anyway so it may not matter. Anything for that
> hundredth of a second, right?
The counter to that is that if one can arrange for the compiler to do as
many (legitimate) yak shaving optimisations as possible, it frees the
programmer's time up to increase funct
be on Linux,
would it be viable to make the default with gcc to be "-g -O2"?
Either way could try to skew third party benchmarks (and the unpublished
private benchmarks we don't even know about) in Parrot's favour.
Nicholas Clark
March,
which suggest that the timing is going to be different this year.
Nicholas Clark
- Forwarded message from LH <[EMAIL PROTECTED]> -
From: "LH" <[EMAIL PROTECTED]>
To: "Summer-Admin-Announce-2006" <[EMAIL PROTECTED]>
Subject: GSoC 2007 is ON!!!
Date:
On Fri, Feb 16, 2007 at 12:42:24AM +0200, Allison Randal wrote:
> Nicholas Clark wrote:
> >
> > What happens if you add a stage with the same name as an existing stage?
>
> It gets added twice. You might repeat a stage like "optimize_tree" or
> "displa
am pmc adverbs :slurpy :named
> +
> +.local string position, target
> +.local pmc stages
> +stages = getattribute self, '@stages'
> +
> +$I0 = exists adverbs['before']
> +unless $I0 goto next_test
> + position = 'before'
What happens if you add a stage with the same name as an existing stage?
Is ambiguity acceptable?
Nicholas Clark
re in writing tests in
Perl 5.
> Is the assumption that skipping a single test with a message is more
> common than skipping a number of tests without a message?
This is my guess too. Probably need to as Schwern to find out the original
(Perl 5) reason.
Nicholas Clark
t I
> may or may not be successful).
HP already provide access to many things, but not Tru64:
http://www.testdrive.hp.com/
Nicholas Clark
tive value happens to be the
errno value. The POSIX threads API avoids conflating value returns with
error returns by specifying that the return value is
success-or-positive-errno, but again it's avoiding anything out of band,
or seemingly-out-of-band.
Nicholas Clark
5 core tests are robust against SEGVing the interpreter
or hitting abort()
Nicholas Clark
ve failed tests before it was checked in?
I'm not convinced that allowing slop in expected output is a good idea.
It introduces (more) complexity into the tests, which increases the chance
for false positives (errors in the tests reporting themselves as failures,
distracting developers) and false negatives (tests not spotting real errors)
Nicholas Clark
On Wed, Jan 03, 2007 at 10:19:23PM +0100, Leopold Toetsch wrote:
> Am Mittwoch, 3. Januar 2007 16:43 schrieb Nicholas Clark:
> > I would think that Sparc Solaris, building 64 bit, would be the best single
> > target to aim for to increase portability spread.
>
> During the la
be fab for ensuring portability :-(
I would think that Sparc Solaris, building 64 bit, would be the best single
target to aim for to increase portability spread.
Nicholas Clark
On Tue, Dec 19, 2006 at 04:30:08PM -0800, Allison Randal wrote:
> Nicholas Clark wrote:
> >
> >To seek clarification - having those as global settings for cperl isn't
> >likely to be an issue? Or having them in editor blocks?
>
> I meant globally.
Ah. There ha
On Tue, Dec 19, 2006 at 01:08:14PM -0800, Allison Randal wrote:
> Nicholas Clark wrote:
> >On Tue, Dec 19, 2006 at 10:05:46AM -0800, Allison Randal wrote:
> >
> >>to every source file, and a maintenance burden. Both vim and emacs allow
> >>top-level settings of t
have the same
standard. (assuming that you're meaning to set the defaults for C and Perl
formatting modes, rather than to use custom parrot-mode variants)
Nicholas Clark
tory, and ICU is C++, so using g++ as the linker means that
all the C++ runtime libraries come in correctly)
Nicholas Clark
trunk/lib/Test/Builder.pm
>
> Log:
> [EMAIL PROTECTED]: cochrane | 2006-11-17 09:46:39 +0100
> [lib] Converted 2-arg form of open() to 3-arg form.
Are you sure you want to do this to bundled external files?
Nicholas Clark
ft missed a trick in that their folks on the C standardisation
committee could have re-drafted the standard to allow 3 or 2 digit exponents,
instead of just 2, and made this non-buggy)
> any case, how does the Perl test suite not fail on Win32?
As to a useful answer, er, I don't know. Sorry.
Nicholas Clark
and having an extra
> attribute specifiable on PMCs like "auto_keyed" (uh, somebody please
> think of a less naff name) that generates missing keyed methods for
> those PMCs that want them.
To me that feels like a hack. The current rather-too-static dispatch (to me)
seems to be the bug, and the thing that needs fixing.
Nicholas Clark
1 - 100 of 903 matches
Mail list logo