IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Opened 17 years ago

Last modified 17 years ago

#1251 reopened defect

psphotTest doesn't compiled under -Werror w/ optimized

Reported by: Michael Wood-Vasey Owned by: magnier
Priority: lowest Milestone:
Component: psphot Version: current
Severity: minor Keywords:
Cc:

Description

Compiling r25188 with

psbuild -rebuild -dev -clean -optimize

the compilation runs through fine until it gets to:

cc -std=gnu99 -DHAVE_CONFIG_H -I. -I/Volumes/data/PS1/code/ipp-2.8/ipp-2.8.darwin/include -D_DARWIN_C_SOURCE -D_DARWIN_C_SOURCE -D_THREAD_SAFE -DHAVE_PSDB -I/Volumes/data/PS1/code/ipp-2.8/ipp-2.8.darwin/include/psmodules -I/Volumes/data/PS1/code/ipp-2.8/ipp-2.8.darwin/include -I/usr/X11/include -I/Volumes/data/PS1/code/ipp-2.8/ipp-2.8.darwin/include/pslib -I/Volumes/data/PS1/code/ipp-2.8/ipp-2.8.darwin/include/mysql -I/sw/include -D_THREAD_SAFE -DHAVE_PSDB -I/Volumes/data/PS1/code/ipp-2.8/ipp-2.8.darwin/include/pslib -I/Volumes/data/PS1/code/ipp-2.8/ipp-2.8.darwin/include/mysql -I/Volumes/data/PS1/code/ipp-2.8/ipp-2.8.darwin/include -I/sw/include -pipe -O2 -g -DPS_NO_TRACE -Wall -Werror -MT psphotTest-psphotTest.o -MD -MP -MF .deps/psphotTest-psphotTest.Tpo -c -o psphotTest-psphotTest.o test -f 'psphotTest.c' || echo './'psphotTest.c
cc1: warnings being treated as errors
psphotTest.c: In function 'main':
psphotTest.c:52: error: statement with no effect
make[2]: * [psphotTest-psphotTest.o] Error 1
make[1]:
* [all] Error 2
make: * [all-recursive] Error 1

Change History (4)

comment:1 by Michael Wood-Vasey, 17 years ago

I get the same error with ppConfigDump.c:51

psTraceSetLevel("err", 10);

---
cc -std=gnu99 -DHAVE_CONFIG_H -I. -I/Volumes/data/PS1/code/ipp-2.8/ipp-2.8.darwin/include/pslib -I/Volumes/data/PS1/code/ipp-2.8/ipp-2.8.darwin/include/mysql -I/Volumes/data/PS1/code/ipp-2.8/ipp-2.8.darwin/include -I/sw/include -D_THREAD_SAFE -DHAVE_PSDB -I/Volumes/data/PS1/code/ipp-2.8/ipp-2.8.darwin/include/pslib -I/Volumes/data/PS1/code/ipp-2.8/ipp-2.8.darwin/include/mysql -I/Volumes/data/PS1/code/ipp-2.8/ipp-2.8.darwin/include -I/sw/include -I/Volumes/data/PS1/code/ipp-2.8/ipp-2.8.darwin/include/psmodules -I/usr/X11/include -D_THREAD_SAFE -DHAVE_PSDB -D_DARWIN_C_SOURCE -pipe -O2 -g -DPS_NO_TRACE -Wall -Werror -MT ppConfigDump-ppConfigDump.o -MD -MP -MF .deps/ppConfigDump-ppConfigDump.Tpo -c -o ppConfigDump-ppConfigDump.o test -f 'ppConfigDump.c' || echo './'ppConfigDump.c
cc1: warnings being treated as errors
ppConfigDump.c: In function 'main':
ppConfigDump.c:51: error: statement with no effect
make[2]: * [ppConfigDump-ppConfigDump.o] Error 1
make[1]:
* [all] Error 2
make: * [all-recursive] Error 1
problem building ppConfigDump : failure in make
---

and looking back, it was the same command that was the problem in psphotTest.c

psTraceSetLevel ("psLib.sys.mutex", 3);

comment:2 by Michael Wood-Vasey, 17 years ago

Ah, I think the pedantically correct thing to do is to cast it to (void).

E.g., in ppSubKernel.c, where this came up again on line 31, I put a (void) in front to make the line

(void) psTraceSetLevel("psModules.imcombine", 7);

and then it compiled under -Wall -Werror without complaint. I will check this change in.

comment:3 by Michael Wood-Vasey, 17 years ago

Resolution: fixed
Status: newclosed

Changes checked in as r24187.

comment:4 by eugene, 17 years ago

Resolution: fixed
Status: closedreopened

this means the PS_NO_TRACE definition of psTraceSetLevel is probably not quite right. we probably need a better NOP int function that does not require gratuitous (void) casting. Currently it is set to:

# define psTraceSetLevel(facil,level) 0 /* previous level was 0 */

Note: See TracTickets for help on using tickets.