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

gcc 7.2.1: compile error #2

Closed zamaudio closed 6 years ago

zamaudio commented 6 years ago
$ make
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  primer3_boulder_main.c
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  -o format_output.o format_output.c
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  -o read_boulder.o read_boulder.c
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  -o print_boulder.o print_boulder.c
g++ -c -g -Wall -D__USE_FIXED_PROTOTYPES__ -O2  masker.c
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
ar rv libprimer3.a libprimer3.o p3_seq_lib.o
ar: creating 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
dpal.c: In function ‘void print_align(const unsigned char*, const unsigned char*, int (*)[1600][3], int, int, const dpal_args*)’:
dpal.c:1036:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
     for(i=j;i<j+70;i++) fprintf(stderr, "%c",sy[i]); fprintf(stderr,"\n");
     ^~~
dpal.c:1036:54: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
     for(i=j;i<j+70;i++) fprintf(stderr, "%c",sy[i]); fprintf(stderr,"\n");
                                                      ^~~~~~~
ar rv libdpal.a dpal_primer.o
ar: creating 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
thal.c: In function ‘void thal(const unsigned char*, const unsigned char*, const thal_args*, thal_results*)’:
thal.c:429:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    if ('\0' == oligo_f) {
                ^~~~~~~
thal.c:434:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    if ('\0' == oligo_r) {
                ^~~~~~~
thal.c: In function ‘void tableStartATS(double, double (*)[5])’:
thal.c:1200:4: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
    for (i = 0; i < 5; ++i)
    ^~~
thal.c:1203:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
      atpS[0][3] = atpS[3][0] = atp_value;
      ^~~~
thal.c: In function ‘void tableStartATH(double, double (*)[5])’:
thal.c:1212:4: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
    for (i = 0; i < 5; ++i)
    ^~~
thal.c:1216:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
      atpH[0][3] = atpH[3][0] = atp_value;
      ^~~~
make: *** [Makefile:207: thal_primer.o] Error 1

$ g++ --version
g++ (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$
nndurj commented 6 years ago

I also got the same error on fedora27. Adding -fpermissive to the flags allowed compilation.

zamaudio commented 6 years ago

Adding -fpermissive just ignores a bigger problem, see #3 for actual fix.

untergasser commented 6 years ago

Thank you for providing a fix, I merged it to master just now. Good work! Best, Andreas