T
Tomás Ó hÉilidhe
When I'm writing my own code, compiling it and testing it out as I go
along, I usually compile as follows:
gcc *.c -ansi -pedantic -Wall -o executable
If I'm using 3rd-party libraries, I'll usually do the following:
gcc *.c -Wall -o executable
When I've already tested my code and I'm distributing it to other
people to use, I tend to tell them to compile as follows:
gcc *.c -o executable
If my code has been well-tested and I'm certain it works perfectly, I
compile as follows:
gcc *.c -O3 -D NDEBUG -s -o executable
I can understand why we don't use "-D NDEBUG" or "-s" when testing
because we want to catch asserts that go off, but I'm curious as to
whether there's any reason to shy away from using "-O3" (or any
optimisations for any compiler for that matter) in debugging version?
along, I usually compile as follows:
gcc *.c -ansi -pedantic -Wall -o executable
If I'm using 3rd-party libraries, I'll usually do the following:
gcc *.c -Wall -o executable
When I've already tested my code and I'm distributing it to other
people to use, I tend to tell them to compile as follows:
gcc *.c -o executable
If my code has been well-tested and I'm certain it works perfectly, I
compile as follows:
gcc *.c -O3 -D NDEBUG -s -o executable
I can understand why we don't use "-D NDEBUG" or "-s" when testing
because we want to catch asserts that go off, but I'm curious as to
whether there's any reason to shy away from using "-O3" (or any
optimisations for any compiler for that matter) in debugging version?