Categories: , ,
Posted by: bjb

Looking at the configure.ac file for gnu-coreutils. It is hard-coded to add the -Werror flag to the gcc command line. Here’s how to remove it. Sometimes you just want to compile a different way to see how it compares with the right way.

 continue reading
Categories:
Posted by: bjb

I recently worked on some c code on an embedded platform with this declaration:

__attribute__((critical)) void somefunc (void) {
    function body ...
}

I’d never seen anything like that.

It turns out that “critical” (and “atomic” and a few other keywords) are part of the open mp spec, where multiprocessing support is being built in to compilers. This has been moving into gcc since 2005 (at least, that’s when I see the mention of “omp” in the changelogs).

Dunno when it will be available on x86 though … it didn’t work on my desktop:

bjb@blueeyes:~/junk/foo$ gcc try1.c -o try1
try1.c:12: warning: 'critical' attribute directive ignored
try1.c:23: warning: 'critical' attribute directive ignored
bjb@blueeyes:~/junk/foo$ gcc --version
gcc (Debian 4.4.5-8) 4.4.5
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

bjb@blueeyes:~/junk/foo$

There was no warning on the customer platform, but it’s presence did not produce a different executable than source code without it.