« first day (1685 days earlier)      last day (3257 days later) » 

11:01 PM
@bwoebi do {} while (0) trick won't work since it's on the RHS; not sure if there's anyway way to do it :(
 
@LeviMorrison spl_recursive_it_from_obj(Z_OBJ_P((assert(zv != NULL), (zv)))) < does that work?
 
It would re-evaluate the zv "parameter" twice.
 
oh yea
minute, let me read up C.
 
It needs to be an actually function, probably.
 
@LeviMorrison I have some nice trick for you…
spl_recursive_it_from_obj(*({zval *_zv = zv; assert(_zv != NULL); &Z_OBJ_P(_zv);}))
 
11:11 PM
@bwoebi It's a GCC extension.
It's not standard C.
 
damn…
 
I'm not sure how widely it is supported, either.
 
@LeviMorrison no idea, but I had seen this type of code in glibc
 
So. Remember that PHP-to-JS compiler I was working on? I had to disable a lot of stuff, but I got it running WordPress... somehow. Benchmarks to make Zeev cry, here.
5
 
Goddamn timezones.
 
11:14 PM
^^
 
@LeviMorrison is there any option in gcc to disable extensions?
 
-pedantic will warn you about them.
 
@bwoebi --std=c89
default is gnu
I think that gets rid of the GNU crap
 
@Andrea that didn't help. pedantic is needed.
 
@Andrea Need -pedantic too
 
11:16 PM
@Andrea I tried that with std earlier^^
 
@LeviMorrison o.O
 
You are right though; it does get rid of some GNU/POSIX stuff.
We do use some GCC extensions but we check for them and aren't required.
__builtin_expect, for instance
 
hmm
 
@LeviMorrison well, llvm-gcc seems to know it
 
did I ever backport using intrinsics for overflow
maybe I should
 
11:19 PM
17
Q: Compiler support of GNU Statement Expression

osgxWhich modern compilers support the Gnu Statement expression (C and C++ languages). What versions should I have to use a statement expressions? Statement expression is smth like ({ code; code; retval }): int b=56; int c= ({int a; a=sin(b); a}) I already know some such compilers: GCC >=3 Clan...

 
@Andrea nahhh, try something more verisimilar next time ^^
 
@bwoebi Personally that rules it out for me. I firmly believe in Intel compilers.
 
@LeviMorrison why isn't that standard C… pfff
 
@bwoebi EVIL
C programmers...
 
Better yet: why are using stupid macros?
 
11:27 PM
why do they think "we need moar side effects in expressions"
why, C programmers
 
@Andrea an assert() isn't a side-effect…
 
Also, I have found some undefined behavior.
 
@LeviMorrison undefined behavior only matters when it misbehaves ^^
 
intern = Z_REFLECTION_P(getThis());
if (intern == NULL /* … */)
 
@LeviMorrison what's undefined about that?
 
11:29 PM
If that is NULL that is a happenstance, completely because we are doing pointer arithmetic in Z_REFLECTION_P.
And even though pointer arithmetic may work on NULL the result is not guaranteed to be NULL so yeah…
That's a guaranteed logic error.
 
just kill them then
I really wish we could use C99… It'd allow us killing ZEND_HASH_FOREACH_END()
 
@bwoebi Hey, I chimed in on that discussion.
We are supposed to push things to some friends of PHP repo to check compiler support or something.
 
@LeviMorrison friends of PHP repo?
 
11:45 PM
@LeviMorrison uh, what…
 
@bwoebi There was a thread on the mailing list and Pierre started that.
Details are fuzzy in my memory.
Subject is "Thoughts on C version supported for PHP-Next"
 

« first day (1685 days earlier)      last day (3257 days later) »