3 msgStrange 'No matching function for call' compila...
5 msgcompiling gcc 4.1.1 for AVR
2 msggfortran compiler precision
2 msgReading and writing binary files

Another strict-alias puzzle with (unsigned) cha...
\ Adam Dickmeiss (26 Sep 2006)
. \ Ian Lance Taylor (27 Sep 2006)

4 msgcannot exec 'cc1plus'
1 msgTest of subscribing
2 msgpeephole2
3 msgcross compilation
3 msgproblem building arm-linux-gcc
3 msgfunctors and callbacks
5 msgProblem with forward declaration of classes wit...
2 msg4.2 release date?
1 msgboehm-gc/misc.c compilation problem on cygwin
1 msgprintf-like syntax
4 msgExtending GNU C extensions
3 msgArguments in registers
2 msghelp: C++, SunStudio and gcc
3 msgPrevious definition of strdup
4 msgg++ -ldl
Subject:Another strict-alias puzzle with (unsigned) char ptrs
Group:Gcc-help
From:Adam Dickmeiss
Date:26 Sep 2006


The program below prints 1 or 0 depending on GCC version and
-O2/-fstrict-aliasing being present or not. With proper optimizations
enabled, 0 is printed. Otherwise, 1 is printed.

So just to understand: strict aliases also take effect for
signed/unsigned char pointers?
/ Adam


#include <stdio.h>

static void decode_ptr(const unsigned char **src)
{
(*src)++;
}

int main(int argc, char **argv)
{
const char *src0 = "";
const char *src = src0;

decode_ptr(&src);
printf("sz = %lld\n", (long long)(src - src0));
}


© 2004-2008 readlist.com