“Colin Burgess” <cburgess@qnx.com> wrote in message
news:a39ob7$43o$1@nntp.qnx.com…
Wojtek Lerch <> wojtek_l@ottawa.com> > wrote:
Bill Caroselli <> qtps@earthlink.net> > wrote:
[snip]
But gcc/qcc does display “warning” about things that simply can’t be
cast
away. I.E. No amount of syntax mumbo-gumbo will get rid of some
warnings.
Exactly. Have any other POSIX platforms managed to declare struct
sigaction and the sigaction() function without getting the “function
hides constructor” warning from g++?
Prepare to be astounded… :v)
Firstly, the good news. You actually have pretty good control over
what is warned about. For example the above “hides constructor” warning
is controlled by the -Wshadow option, which can be turned off with
-Wno-shadow.
The bad news is our project requires -Wall without any exception.
But here’s the interesting thing… gcc actually knows that system
headers (which it often doesn’t have control over) have problems, and
in some cases they aren’t gonna change. So they actually disable most
I certainly hope “they” do not include QNX.
warnings for headers that are ‘system’ headers, and have a special
preprossor directive -isystem that you use for your system header
directories.
So what Mr Lee is seeing is a result of codewarrior or something else
doing
an -I $QNX_TARGET/usr/include, since this will include the system dirs
without marking them as ‘system’.
We don’t use codewarrior. Our clearcase admin controls the makefile and the
make
process so the developer can’t cheat easily. If we do that, we might
encounter
the same problem of with all the warnings in “production level” code be
discovered
by customers.
Shouldn’t the gcc pickup the “system” attribute from #include <stdlib.h>
instead of
#include “stdlib.h”.
Anyway thanks for the suggestion, but it doesn’t work. Here’s the log.
Z:\frvob_base\src\ukernel\ipc>cmake “MOD_CFLAGS=-g -W
p,-isystem,D:/ErgTools/QNXsdk/target/qnx6/usr/include” pfsw_ipc.o
============> TARGET: [FR_UINOS] pfsw_ipc.o
rm -f …/…/…/frbld/FR_UINOS/obj/ukernel/ipc/pfsw_ipc.o
qcc pfsw_ipc.cpp -xc++ -c -o
…/…/…/frbld/FR_UINOS/obj/ukernel/ipc/pfsw_ipc.o -V
gcc_ntox86 -fPIC -Wshadow -Wmissing-p
rototypes -Wmissing-declarations -Wall -D_POSIX_C_SOURCE=POSIX_VERSION -D_
EXTENSIONS__ -D__EXT_XOPEN_EX -DHW=FR -DIMAG
E=UINOS -g -W
p,-isystem,D:/ErgTools/QNXsdk/target/qnx6/usr/include -I…/…/…/hw/FR -ID:/
ErgTools/QNXsdk/target/qnx6/us
r/include -Ih -I…/…/…/frbld/FR_UINOS/pvtexp -I…/…/global/h -I…/…/…/f
rbld/FR_UINOS/exp -I…/…/ukernel/h -I…/…/
ukernel/ns/h -I…/…/ukernel/timer/h -I…/…/ukernel/trace/h
In file included from pfsw_ipc.cpp:30:
D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h: In function void * std::memchr(void *, int, unsigned int)': D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h:125: declaration of C function
void * std::memchr(void *, int, unsi
gned int)’ conflicts with
D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h:49: previous declaration
const void * std::memchr(const void *, int , unsigned int)' here D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h: In function
void *
std::memchr(void *, int, unsigned int)’:
D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h:127: passing const void *' as argument 1 of
std::memchr(void *, in
t, unsigned int)’ discards qualifiers
D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h: In function char * std::strchr(char *, int)': D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h:130: declaration of C function
char * std::strchr(char *, int)’ con
flicts with
D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h:50: previous declaration
const char * std::strchr(const char *, int )' here D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h: In function
char *
std::strchr(char *, int)’:
D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h:132: passing const char *' as argument 1 of
std::strchr(char *, in
t)’ discards qualifiers
D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h: In function char * std::strpbrk(char *, const char *)': D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h:135: declaration of C function
char * std::strpbrk(char *, const ch
ar *)’ conflicts with
D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h:51: previous declaration
const char * std::strpbrk(const char *, co nst char *)' here D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h: In function
char *
std::strpbrk(char *, const char *)’:
D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h:137: passing const char *' as argument 1 of
std::strpbrk(char *, c
onst char *)’ discards qualifiers
D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h: In function char * std::strrchr(char *, int)': D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h:140: declaration of C function
char * std::strrchr(char *, int)’ co
nflicts with
D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h:52: previous declaration
const char * std::strrchr(const char *, in t)' here D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h: In function
char *
std::strrchr(char *, int)’:
D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h:142: passing const char *' as argument 1 of
std::strrchr(char *, i
nt)’ discards qualifiers
D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h: In function char * std::strstr(char *, const char *)': D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h:145: declaration of C function
char * std::strstr(char *, const cha
r *)’ conflicts with
D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h:53: previous declaration
const char * std::strstr(const char *, con st char *)' here D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h: In function
char *
std::strstr(char *, const char *)’:
D:/ErgTools/QNXsdk/target/qnx6/usr/include/string.h:147: passing const char *' as argument 1 of
std::strstr(char *, co
nst char *)’ discards qualifiers
cc: d:/ergtools/QNXsdk/host/win32/usr/gcc/lib/gcc-lib/ntox86/2.95.2/cc1plus
caught signal 33
============> Done with target: [FR_UINOS] pfsw_ipc.o _____________________
Joy! :v)
–
cburgess@qnx.com