primer3-org / primer3

Primer3 is a command line tool to select primers for polymerase chain reaction (PCR).
GNU General Public License v2.0
219 stars 63 forks source link

number of warnings building with clang on macOS #22

Closed nivekkagicom closed 2 years ago

nivekkagicom commented 5 years ago

There a several warnings building with clang on macOS that

g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  primer3_boulder_main.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  -o format_output.o format_output.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
format_output.c:418:48: warning: comparison of address of 'retval->rev' not equal to a null pointer is always true [-Wtautological-pointer-compare]
            if (pa->pick_right_primer && &retval->rev != NULL 
                                          ~~~~~~~~^~~    ~~~~
format_output.c:429:47: warning: comparison of address of 'retval->fwd' not equal to a null pointer is always true [-Wtautological-pointer-compare]
            if (pa->pick_left_primer && &retval->fwd != NULL 
                                         ~~~~~~~~^~~    ~~~~
format_output.c:851:45: warning: comparison of address of 'retval->fwd' not equal to a null pointer is always true [-Wtautological-pointer-compare]
    if ((pa->pick_left_primer) && (&retval->fwd != NULL )
                                    ~~~~~~~~^~~    ~~~~
format_output.c:858:48: warning: comparison of address of 'retval->intl' not equal to a null pointer is always true [-Wtautological-pointer-compare]
    if ((pa->pick_internal_oligo) && (&retval->intl != NULL )
                                       ~~~~~~~~^~~~    ~~~~
format_output.c:865:46: warning: comparison of address of 'retval->rev' not equal to a null pointer is always true [-Wtautological-pointer-compare]
    if ((pa->pick_right_primer) && (&retval->rev != NULL )
                                     ~~~~~~~~^~~    ~~~~
format_output.c:888:43: warning: comparison of address of 'retval->fwd' not equal to a null pointer is always true [-Wtautological-pointer-compare]
  if ((pa->pick_left_primer) && (&retval->fwd != NULL )
                                  ~~~~~~~~^~~    ~~~~
format_output.c:907:46: warning: comparison of address of 'retval->intl' not equal to a null pointer is always true [-Wtautological-pointer-compare]
  if ((pa->pick_internal_oligo) && (&retval->intl != NULL )
                                     ~~~~~~~~^~~~    ~~~~
format_output.c:926:44: warning: comparison of address of 'retval->rev' not equal to a null pointer is always true [-Wtautological-pointer-compare]
  if ((pa->pick_right_primer) && (&retval->rev != NULL )
                                   ~~~~~~~~^~~    ~~~~
8 warnings generated.
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  -o read_boulder.o read_boulder.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  -o print_boulder.o print_boulder.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  masker.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -Wno-deprecated  -o libprimer3.o libprimer3.c
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -o p3_seq_lib.o p3_seq_lib.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
ar rv libprimer3.a libprimer3.o p3_seq_lib.o
ar: creating archive libprimer3.a
a - libprimer3.o
a - p3_seq_lib.o
ranlib libprimer3.a
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  -o dpal_primer.o dpal.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
ar rv libdpal.a dpal_primer.o
ar: creating archive libdpal.a
a - dpal_primer.o
ranlib libdpal.a
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -ffloat-store  -o thal_primer.o thal.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang: warning: optimization flag '-ffloat-store' is not supported [-Wignored-optimization-argument]
ar rv libthal.a thal_primer.o
ar: creating archive libthal.a
a - thal_primer.o
ranlib libthal.a
gcc -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2   -c -o oligotm.o oligotm.c
ar rv liboligotm.a oligotm.o
ar: creating archive liboligotm.a
a - oligotm.o
ranlib liboligotm.a
ar rv libmasker.a masker.o
ar: creating archive libmasker.a
a - masker.o
ranlib libmasker.a
g++ -g -o primer3_core primer3_boulder_main.o format_output.o read_boulder.o print_boulder.o masker.o libprimer3.a libdpal.a libthal.a liboligotm.a libmasker.a  -lm
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -o ntdpal_main.o ntdpal_main.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -o dpal.o dpal.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
g++ -g -o ntdpal ntdpal_main.o dpal.o
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -o thal_main.o thal_main.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -ffloat-store -o thal.o thal.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
clang: warning: optimization flag '-ffloat-store' is not supported [-Wignored-optimization-argument]
g++ -g -o ntthal thal_main.o thal.o -lm
g++ -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -o oligotm oligotm_main.c liboligotm.a  -lm
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
g++ -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -o long_seq_tm_test long_seq_tm_test_main.c oligotm.o  -lm
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
g++ -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2 -o primer3_masker masker_main.c libprimer3.a libdpal.a libthal.a liboligotm.a libmasker.a  -lm
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
untergasser commented 2 years ago

Thank you for the hint. Just for the record - this warning: is fixed by changing

format_output.c:418:48: warning: comparison of address of 'retval->rev' not equal to a null pointer is always true [-Wtautological-pointer-compare]

is fixed by changing:

&retval->rev != NULL

to:

(&retval->rev) != NULL

Took me some time to figure this out...

Best, Andreas