Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler warnings #5

Closed
manodeep opened this issue May 18, 2018 · 1 comment
Closed

Compiler warnings #5

manodeep opened this issue May 18, 2018 · 1 comment
Assignees

Comments

@manodeep
Copy link
Owner

@darrencroton got this output while compiling. Two issues:

  • Those compiler warnings are real and need to be fixed.
  • gcc is clang but the Makefile should pick that up (and not use the -Wa,-q flag needed to use the clang assembler for true gcc)
gcc -DUSE_STRINGPARSE -ggdb  -Wsign-compare -Wall -Wextra -Wshadow -Wunused -std=c99 -g -m64 -fPIC  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_BSD_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=200809L -D_SVID_SOURCE -D_DARWIN_C_SOURCE -O3 -Ofast -ftree-vectorize -flto -funroll-loops  -march=native -fno-strict-aliasing -Wformat=2  -Wpacked  -Wnested-externs -Wpointer-arith  -Wredundant-decls  -Wfloat-equal  -Wcast-align  -Wnested-externs -Wstrict-prototypes   -Wa,-q  -c main.c -o main.o
clang: warning: argument unused during compilation: '-Wa,-q' [-Wunused-command-line-argument]
gcc -DUSE_STRINGPARSE -ggdb  -Wsign-compare -Wall -Wextra -Wshadow -Wunused -std=c99 -g -m64 -fPIC  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_BSD_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=200809L -D_SVID_SOURCE -D_DARWIN_C_SOURCE -O3 -Ofast -ftree-vectorize -flto -funroll-loops  -march=native -fno-strict-aliasing -Wformat=2  -Wpacked  -Wnested-externs -Wpointer-arith  -Wredundant-decls  -Wfloat-equal  -Wcast-align  -Wnested-externs -Wstrict-prototypes   -Wa,-q  -c convert_trees_to_lhalo.c -o convert_trees_to_lhalo.o
clang: warning: argument unused during compilation: '-Wa,-q' [-Wunused-command-line-argument]
convert_trees_to_lhalo.c:899:30: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
            if((info[i].upid == fof_id) ) {
                ~~~~~~~~~~~~~^~~~~~~~~
convert_trees_to_lhalo.c:899:30: note: remove extraneous parentheses around the comparison to silence this warning
            if((info[i].upid == fof_id) ) {
               ~             ^        ~
convert_trees_to_lhalo.c:899:30: note: use '=' to turn this equality comparison into an assignment
            if((info[i].upid == fof_id) ) {
                             ^~
                             =
1 warning generated.
gcc -DUSE_STRINGPARSE -ggdb  -Wsign-compare -Wall -Wextra -Wshadow -Wunused -std=c99 -g -m64 -fPIC  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_BSD_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=200809L -D_SVID_SOURCE -D_DARWIN_C_SOURCE -O3 -Ofast -ftree-vectorize -flto -funroll-loops  -march=native -fno-strict-aliasing -Wformat=2  -Wpacked  -Wnested-externs -Wpointer-arith  -Wredundant-decls  -Wfloat-equal  -Wcast-align  -Wnested-externs -Wstrict-prototypes   -Wa,-q  -c utils.c -o utils.o
clang: warning: argument unused during compilation: '-Wa,-q' [-Wunused-command-line-argument]
utils.c:159:62: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'int64_t' (aka 'long long')
      [-Wformat]
                fprintf(stderr,"Could not write %zu bytes\n",bytes_read);
                                                ~~~          ^~~~~~~~~~
                                                %lld
1 warning generated.
gcc -DUSE_STRINGPARSE -ggdb  -Wsign-compare -Wall -Wextra -Wshadow -Wunused -std=c99 -g -m64 -fPIC  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_BSD_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=200809L -D_SVID_SOURCE -D_DARWIN_C_SOURCE -O3 -Ofast -ftree-vectorize -flto -funroll-loops  -march=native -fno-strict-aliasing -Wformat=2  -Wpacked  -Wnested-externs -Wpointer-arith  -Wredundant-decls  -Wfloat-equal  -Wcast-align  -Wnested-externs -Wstrict-prototypes   -Wa,-q  -c progressbar.c -o progressbar.o
clang: warning: argument unused during compilation: '-Wa,-q' [-Wunused-command-line-argument]
gcc -DUSE_STRINGPARSE -ggdb  -Wsign-compare -Wall -Wextra -Wshadow -Wunused -std=c99 -g -m64 -fPIC  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_BSD_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=200809L -D_SVID_SOURCE -D_DARWIN_C_SOURCE -O3 -Ofast -ftree-vectorize -flto -funroll-loops  -march=native -fno-strict-aliasing -Wformat=2  -Wpacked  -Wnested-externs -Wpointer-arith  -Wredundant-decls  -Wfloat-equal  -Wcast-align  -Wnested-externs -Wstrict-prototypes   -Wa,-q  -c stringparse.c -o stringparse.o
clang: warning: argument unused during compilation: '-Wa,-q' [-Wunused-command-line-argument]
In file included from stringparse.c:9:
./strtonum.c:119:15: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
  if (savedval==0) return copysign(0, sign);
      ~~~~~~~~^ ~
In file included from stringparse.c:11:
./strtonum.c:119:15: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
  if (savedval==0) return copysign(0, sign);
      ~~~~~~~~^ ~
2 warnings generated.
gcc -DUSE_STRINGPARSE -ggdb  -Wsign-compare -Wall -Wextra -Wshadow -Wunused -std=c99 -g -m64 -fPIC  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_BSD_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=200809L -D_SVID_SOURCE -D_DARWIN_C_SOURCE -O3 -Ofast -ftree-vectorize -flto -funroll-loops  -march=native -fno-strict-aliasing -Wformat=2  -Wpacked  -Wnested-externs -Wpointer-arith  -Wredundant-decls  -Wfloat-equal  -Wcast-align  -Wnested-externs -Wstrict-prototypes   -Wa,-q  -c check_syscalls.c -o check_syscalls.o
clang: warning: argument unused during compilation: '-Wa,-q' [-Wunused-command-line-argument]
gcc main.o convert_trees_to_lhalo.o utils.o progressbar.o stringparse.o check_syscalls.o  -flto -lm -ggdb  -Wsign-compare -Wall -Wextra -Wshadow -Wunused -std=c99 -g -m64 -fPIC  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_BSD_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=200809L -D_SVID_SOURCE -D_DARWIN_C_SOURCE -O3 -Ofast -ftree-vectorize -flto -funroll-loops  -march=native -fno-strict-aliasing -Wformat=2  -Wpacked  -Wnested-externs -Wpointer-arith  -Wredundant-decls  -Wfloat-equal  -Wcast-align  -Wnested-externs -Wstrict-prototypes   -Wa,-q -o convert_trees_to_lhalo
clang: warning: argument unused during compilation: '-Wa,-q' [-Wunused-command-line-argument]
gcc -DUSE_STRINGPARSE -ggdb  -Wsign-compare -Wall -Wextra -Wshadow -Wunused -std=c99 -g -m64 -fPIC  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_BSD_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=200809L -D_SVID_SOURCE -D_DARWIN_C_SOURCE -O3 -Ofast -ftree-vectorize -flto -funroll-loops  -march=native -fno-strict-aliasing -Wformat=2  -Wpacked  -Wnested-externs -Wpointer-arith  -Wredundant-decls  -Wfloat-equal  -Wcast-align  -Wnested-externs -Wstrict-prototypes   -Wa,-q  -c tests/compare_two_lhalotree.c -o tests/compare_two_lhalotree.o
clang: warning: argument unused during compilation: '-Wa,-q' [-Wunused-command-line-argument]
gcc tests/compare_two_lhalotree.o utils.o  -flto -lm -ggdb  -Wsign-compare -Wall -Wextra -Wshadow -Wunused -std=c99 -g -m64 -fPIC  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_BSD_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=200809L -D_SVID_SOURCE -D_DARWIN_C_SOURCE -O3 -Ofast -ftree-vectorize -flto -funroll-loops  -march=native -fno-strict-aliasing -Wformat=2  -Wpacked  -Wnested-externs -Wpointer-arith  -Wredundant-decls  -Wfloat-equal  -Wcast-align  -Wnested-externs -Wstrict-prototypes   -Wa,-q -o compare_two_lhalotree
clang: warning: argument unused during compilation: '-Wa,-q' [-Wunused-command-line-argument]
@manodeep manodeep self-assigned this May 18, 2018
manodeep added a commit that referenced this issue May 20, 2018
The first compiler warning related to #5
manodeep added a commit that referenced this issue May 20, 2018
Fixed second compiler warning in #5
manodeep added a commit that referenced this issue May 20, 2018
Fixing the "argument unused during compilation" warning in #5
@manodeep
Copy link
Owner Author

Not fixing the warning strtonum. Other warnings are fixed now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant