[cvs] bogofilter/src mime.c,1.33,1.34

Matthias Andree matthias.andree at gmx.de
Mon Jan 3 15:31:24 CET 2005


relson at users.sourceforge.net writes:

> +    const size_t l =  sizeof("Content-Transfer-Encoding:") - 1;

OK, this is correct but I still don't like it.

Compilers IMO are supposed to evaluate all constant expressions at
compile time - GCC 3.3 and ICC 8.1 certainly are:

$ cat test.c
unsigned f() {
    unsigned l = strlen("test string");
    return l;
}
$ gcc -fomit-frame-pointer -O -c test.c
$ objdump -d test.o
[...]
00000000 <f>:
   0:   b8 0b 00 00 00          mov    $0xb,%eax
   5:   c3                      ret    

ICC generates the same with two additional "nop" (0x90) pad bytes.

-- 
Matthias Andree



More information about the bogofilter-dev mailing list