Hi,

Wolfgang Lux wrote:
Does it still segfault if you compile the program with "gcc -O2 config.align.c" and then 
run "a.out"? It's about a decade ago that I have been using a Sparc machine, but I recall 
having a similar problem where gcc was generating code with different alignment constraints 
depending on whether optimization was turned on or not. Though in my case the problem was for 
floating point numbers.
so it is! the version compiled with gcc -O2 does not crash.

I wonder if we can foce executing the test without opt. flags or complicate so that it doesn't get optimized..

During compilation I get these warnings:
config.align.c: In function 'main':
config.align.c:13:16: warning: incompatible implicit declaration of built-in function 'malloc'
   char  *buf = malloc(30);
                ^
config.align.c:27:6: warning: assignment from incompatible pointer type
   sp = (short*)(v + 1);
      ^
config.align.c:28:6: warning: assignment from incompatible pointer type
   sq = (short*)(v + 2);
      ^

I think the twp sp and sq variable should be declared "short". But that doesn't change that we need to fool the compiler better.

R

_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to