Wednesday, 28 March 2012

URGENT: please check your compilers

Hi,

I want to inline a bunch of libwapcaplet in order to allow for greater
efficiency throughout our codebase.

A quick test here suggests we're in for around 1.5% improvement in speed by
inlining this stuff. Unfortunately it will rely on a C feature called
'braced-groups' which ISO C/C++ forbids. GCC normally allows them unless you
pass -pedantic (which we do for somethings right now, so we'd have to stop
doing that) but I'm unsure if everyone's compilers will support them.

Since libwapcaplet's header is exposed to frontends, we need to be certain that
the unusual compilers such at the obj-c stuff on the cocoa frontend and the g++
on the beos/haiku one allow braced-groups.

A simple test could be:

petitemort% cat test.c
int foo()
{
return ({ int a = 1; int b = 2; a + b; });
}
petitemort% gcc -pedantic -c test.c
test.c: In function 'foo':
test.c:3:9: warning: ISO C forbids braced-groups within expressions [-pedantic]
petitemort% gcc -c test.c
petitemort%

In the example above, with pedantic on, the warning is generated, but with it
off, it's not. Now my GCC is modern and I'm on amd64 so I'm asking everyone to
check that their target compilers support the above.

If everyone's okay with it, then I'll make the changes to the libs (to disable
pedantic) and then make the wapcaplet change [which will require a full rebuild
because it's an ABI change of significant proportions]. I'd like to decide one
way or the other by the weekend, so can people please check and report to the
list their findings.

Thanks,

Daniel.

--
Daniel Silverstone http://www.netsurf-browser.org/
PGP mail accepted and encouraged. Key Id: 3CCE BABE 206C 3B69

No comments:

Post a Comment