C Compiler not working well

My problem is when I compile my .c file on openSUSE 11.1, by using either cc or gcc in the terminal, the program doesn’t run properly. I have a Macbook and my program compiles just fine with cc and works as expected.

Any ideas?

More info: what do you mean by “not running properly?” Are you getting errors, and if so, what are they?

Sorry I should of been more specific, what is happening is although my input for my program is the same when running on OS X and openSUSE, the outputs are different.

Example:

On OS X:

Cthulhu:Desktop nicholasquirk$ ./a.out

Enter the size of the array: 5

Enter your 5 numbers here: -2 6 -5 7 23

Your array is: -2 6 -5 7 23

Your array is: -5 -2 6 7 23

Counting Sort w/o Stability: -5 -2 6 7 23

Yet on openSUSE, I would get something like:

Enter the size of the array: 5

Enter your 5 numbers here: -2 6 -5 7 23

Your array is: -2 6 -5 7 23

Your array sorted is: -5 -2 6 7 23

Counting Sort w/o Stability: -5 -2 6 7 7 23 23

I get the correct output when compiling on OS X, but not on openSUSE.

Chances are it’s a bug in your program but we can’t tell unless you post the source.

Most likely a bug in your program >:)

post the source code and the output of the compiler, when you use


gcc -Wall $(rpm --eval %optflags) your_program.c