[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#330521: different results for different parameters order



Package: gcc-4.0
Version: 4.0.1-9
Severity: normal

Hi

while compiling with different parameters order you get different
results:

$ gcc -g -L/usr/X11R6/lib/ -lGL -lglut -lGLU -pthread -Wall configure.c -o configure.bin 
configure.c: In function ‘main’:
configure.c:11: warning: assignment discards qualifiers from pointer target type
$ ./configure.bin 
$ gcc -g configure.c -L/usr/X11R6/lib/ -lGL -lglut -lGLU -pthread -Wall -o configure.bin 
configure.c: In function ‘main’:
configure.c:11: warning: assignment discards qualifiers from pointer target type
$ ./configure.bin 
Segmentation fault

Note that only source filename has moved from end to beginning and
program runs differently (segfault is a code problem). This is taken
from configure of Raydium engine [1], problematic file attached to bug
report.

1. http://raydium.cqfd-corp.org/

Preprocessed files (*.i) and assembly (*.s) are same in both cases, 
only difference is how collect2 is called, once (in failing case)
resulting object is before GL libs, second time after then. But order 
should not matter, or am I wrong?

I hope I provided enough information.

    Michal

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/dash
Kernel: Linux 2.6.12
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)

Versions of packages gcc-4.0 depends on:
ii  binutils             2.16.1cvs20050902-1 The GNU assembler, linker and bina
ii  cpp-4.0              4.0.1-9             The GNU C preprocessor
ii  gcc-4.0-base         4.0.1-9             The GNU Compiler Collection (base 
ii  libc6                2.3.5-6             GNU C Library: Shared libraries an
ii  libgcc1              1:4.0.1-9           GCC support library

Versions of packages gcc-4.0 recommends:
ii  libc6-dev                     2.3.5-6    GNU C Library: Development Librari
ii  libmudflap0-dev               4.0.1-9    GCC mudflap support libraries (dev

-- no debconf information
#include <stdio.h>
#include <string.h>
#include <GL/glut.h>
int main(int argc, char **argv) { 
char *r;
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(320,240);
glutCreateWindow("Test window");
r=glGetString(GL_RENDERER);
if(!strcmp(r,"Mesa GLX Indirect"))
    {
    fprintf(stderr,"WARNING ! Mesa Software renderer detected !");
    fprintf(stdout,"WARNING ! Mesa Software renderer detected !");
    }
return 0; }


Reply to: