gcc __may_alias__ wonders

Till Straumann strauman at slac.stanford.edu
Fri Dec 15 05:07:17 UTC 2006


I started to play with __attribute__((__may_alias__))
and here's what gcc now fills my screen with:

warning: format '%08lx' expects type 'long unsigned int', but argument 2 
has type 'long unsigned int'

(because the argument 2 has the attribute __may_alias__)

this alias crap is really annoying...

#include <stdio.h>

typedef volatile long unsigned xxx __attribute__((__may_alias__));

extern xxx x;

void test()
{
printf("0x%lx\n",x);
}

gcc -Wall -c test.c

-- Till

-- C is not Java --





More information about the users mailing list