diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 996f984487..d00f55647a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,45 @@ The license applies to all entries newer than 2009-04-28. */ +2011-01-14 10:12 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/config/beos/gcc.mk + * harbour/config/qnx/gcc.mk + * harbour/config/bsd/gcc.mk + * harbour/config/wce/mingwarm.mk + * harbour/config/vxworks/gcc.mk + * harbour/config/hpux/gcc.mk + * harbour/config/darwin/gcc.mk + * harbour/config/dos/djgpp.mk + * harbour/config/win/mingw.mk + * harbour/config/linux/gcc.mk + * harbour/config/cygwin/gcc.mk + * harbour/config/symbian/gcc.mk + * harbour/config/os2/gcc.mk + * harbour/config/sunos/gcc.mk + * use -Wall -Wno-unused -Wno-pointer-sign -Wno-uninitialized + -Wno-switch -Wno-strict-overflow -Wno-main + instead of -W when warnings are not enabled with GCC based compilers. + Using only -W only is rather useless because this switch enables + warnings which can be usually ignored in 3-rd party code. + This modification should help in locating bugs introduced by us + to 3-rd party code, i.e. due to wrong header files used on some + platforms (we do not use autoconf assuming some default settings + what can be wrong in some cases). It should also not hide some + important/critical bugs in 3-rd party code. + This modification pacifies some common warnings which can be + ignored usually but it also enables some more important ones. + If it's necessary then we can tune it a little bit more and disable + some other warnings too. + It's possible that on some platforms using very old GCC versions + some of -W* switches are not supported - please make tests and + inform us about problems. + + * harbour/utils/hbmk2/hbmk2.prg + * use -Wall -Wno-unused -Wno-pointer-sign -Wno-uninitialized + -Wno-switch -Wno-strict-overflow -Wno-main + instead of -W when warning level is set to low with GCC based + compilers + 2011-01-14 08:35 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbdefs.h * use native stdint.h for MSVC 2010. Patch by Andi, thx. diff --git a/harbour/config/beos/gcc.mk b/harbour/config/beos/gcc.mk index 229aa6ac13..a9284e4675 100644 --- a/harbour/config/beos/gcc.mk +++ b/harbour/config/beos/gcc.mk @@ -23,7 +23,7 @@ CFLAGS += -I. -I$(HB_HOST_INC) ifneq ($(HB_BUILD_WARN),no) CFLAGS += -W -Wall else - CFLAGS += -W + CFLAGS += -Wall -Wno-unused -Wno-pointer-sign -Wno-uninitialized -Wno-switch -Wno-strict-overflow -Wno-main endif ifneq ($(HB_BUILD_OPTIM),no) diff --git a/harbour/config/bsd/gcc.mk b/harbour/config/bsd/gcc.mk index 33c7df1253..bc59b6fa6f 100644 --- a/harbour/config/bsd/gcc.mk +++ b/harbour/config/bsd/gcc.mk @@ -25,7 +25,7 @@ CFLAGS += -I. -I$(HB_HOST_INC) ifneq ($(HB_BUILD_WARN),no) CFLAGS += -W -Wall else - CFLAGS += -W + CFLAGS += -Wall -Wno-unused -Wno-pointer-sign -Wno-uninitialized -Wno-switch -Wno-strict-overflow -Wno-main endif ifneq ($(HB_BUILD_OPTIM),no) diff --git a/harbour/config/cygwin/gcc.mk b/harbour/config/cygwin/gcc.mk index 3602e33c5b..2cf6fa1605 100644 --- a/harbour/config/cygwin/gcc.mk +++ b/harbour/config/cygwin/gcc.mk @@ -21,7 +21,7 @@ CFLAGS += -I. -I$(HB_HOST_INC) ifneq ($(HB_BUILD_WARN),no) CFLAGS += -W -Wall else - CFLAGS += -W + CFLAGS += -Wall -Wno-unused -Wno-pointer-sign -Wno-uninitialized -Wno-switch -Wno-strict-overflow -Wno-main endif ifneq ($(HB_BUILD_OPTIM),no) diff --git a/harbour/config/darwin/gcc.mk b/harbour/config/darwin/gcc.mk index 548991ac8f..8b7c96b3c2 100644 --- a/harbour/config/darwin/gcc.mk +++ b/harbour/config/darwin/gcc.mk @@ -31,7 +31,7 @@ CFLAGS += -fno-common ifneq ($(HB_BUILD_WARN),no) CFLAGS += -W -Wall else - CFLAGS += -W + CFLAGS += -Wall -Wno-unused -Wno-pointer-sign -Wno-uninitialized -Wno-switch -Wno-strict-overflow -Wno-main endif ifneq ($(HB_BUILD_OPTIM),no) diff --git a/harbour/config/dos/djgpp.mk b/harbour/config/dos/djgpp.mk index 1e446ed9c1..d0da345b17 100644 --- a/harbour/config/dos/djgpp.mk +++ b/harbour/config/dos/djgpp.mk @@ -22,7 +22,7 @@ CFLAGS += -I. -I$(HB_HOST_INC) ifneq ($(HB_BUILD_WARN),no) CFLAGS += -W -Wall else - CFLAGS += -W + CFLAGS += -Wall -Wno-unused -Wno-pointer-sign -Wno-uninitialized -Wno-switch -Wno-strict-overflow -Wno-main endif ifneq ($(HB_BUILD_OPTIM),no) diff --git a/harbour/config/hpux/gcc.mk b/harbour/config/hpux/gcc.mk index 0a9b30d846..83d88a708b 100644 --- a/harbour/config/hpux/gcc.mk +++ b/harbour/config/hpux/gcc.mk @@ -27,7 +27,7 @@ CFLAGS += -I. -I$(HB_HOST_INC) ifneq ($(HB_BUILD_WARN),no) CFLAGS += -W -Wall else - CFLAGS += -W + CFLAGS += -Wall -Wno-unused -Wno-pointer-sign -Wno-uninitialized -Wno-switch -Wno-strict-overflow -Wno-main endif ifneq ($(HB_BUILD_OPTIM),no) diff --git a/harbour/config/linux/gcc.mk b/harbour/config/linux/gcc.mk index 33c7df1253..bc59b6fa6f 100644 --- a/harbour/config/linux/gcc.mk +++ b/harbour/config/linux/gcc.mk @@ -25,7 +25,7 @@ CFLAGS += -I. -I$(HB_HOST_INC) ifneq ($(HB_BUILD_WARN),no) CFLAGS += -W -Wall else - CFLAGS += -W + CFLAGS += -Wall -Wno-unused -Wno-pointer-sign -Wno-uninitialized -Wno-switch -Wno-strict-overflow -Wno-main endif ifneq ($(HB_BUILD_OPTIM),no) diff --git a/harbour/config/os2/gcc.mk b/harbour/config/os2/gcc.mk index e8de6394f5..5cdb5c6b13 100644 --- a/harbour/config/os2/gcc.mk +++ b/harbour/config/os2/gcc.mk @@ -30,7 +30,7 @@ endif ifneq ($(HB_BUILD_WARN),no) CFLAGS += -W -Wall else - CFLAGS += -W + CFLAGS += -Wall -Wno-unused -Wno-pointer-sign -Wno-uninitialized -Wno-switch -Wno-strict-overflow -Wno-main endif ifneq ($(HB_BUILD_OPTIM),no) diff --git a/harbour/config/qnx/gcc.mk b/harbour/config/qnx/gcc.mk index 44b5d5a63b..b480a90433 100644 --- a/harbour/config/qnx/gcc.mk +++ b/harbour/config/qnx/gcc.mk @@ -25,7 +25,7 @@ CFLAGS += -I. -I$(HB_HOST_INC) ifneq ($(HB_BUILD_WARN),no) CFLAGS += -W -Wall else - CFLAGS += -W + CFLAGS += -Wall -Wno-unused -Wno-pointer-sign -Wno-uninitialized -Wno-switch -Wno-strict-overflow -Wno-main endif ifneq ($(HB_BUILD_OPTIM),no) diff --git a/harbour/config/sunos/gcc.mk b/harbour/config/sunos/gcc.mk index 17bae80e3a..61bedee631 100644 --- a/harbour/config/sunos/gcc.mk +++ b/harbour/config/sunos/gcc.mk @@ -25,7 +25,7 @@ CFLAGS += -I. -I$(HB_HOST_INC) ifneq ($(HB_BUILD_WARN),no) CFLAGS += -W -Wall else - CFLAGS += -W + CFLAGS += -Wall -Wno-unused -Wno-pointer-sign -Wno-uninitialized -Wno-switch -Wno-strict-overflow -Wno-main endif ifneq ($(HB_BUILD_OPTIM),no) diff --git a/harbour/config/symbian/gcc.mk b/harbour/config/symbian/gcc.mk index 6db85921d7..3fd3828903 100644 --- a/harbour/config/symbian/gcc.mk +++ b/harbour/config/symbian/gcc.mk @@ -25,7 +25,7 @@ CFLAGS += -I. -I$(HB_HOST_INC) ifneq ($(HB_BUILD_WARN),no) CFLAGS += -W -Wall else - CFLAGS += -W + CFLAGS += -Wall -Wno-unused -Wno-pointer-sign -Wno-uninitialized -Wno-switch -Wno-strict-overflow -Wno-main endif ifneq ($(HB_BUILD_OPTIM),no) diff --git a/harbour/config/vxworks/gcc.mk b/harbour/config/vxworks/gcc.mk index f71444d3cc..006f61dd47 100644 --- a/harbour/config/vxworks/gcc.mk +++ b/harbour/config/vxworks/gcc.mk @@ -35,7 +35,7 @@ CFLAGS += -D_C99 -D_HAS_C9X ifneq ($(HB_BUILD_WARN),no) CFLAGS += -W -Wall else - CFLAGS += -W + CFLAGS += -Wall -Wno-unused -Wno-pointer-sign -Wno-uninitialized -Wno-switch -Wno-strict-overflow -Wno-main endif ifneq ($(HB_BUILD_OPTIM),no) diff --git a/harbour/config/wce/mingwarm.mk b/harbour/config/wce/mingwarm.mk index bc4c5f2163..643fdcaa73 100644 --- a/harbour/config/wce/mingwarm.mk +++ b/harbour/config/wce/mingwarm.mk @@ -21,7 +21,7 @@ CFLAGS += -I. -I$(HB_HOST_INC) ifneq ($(HB_BUILD_WARN),no) CFLAGS += -W -Wall else - CFLAGS += -W + CFLAGS += -Wall -Wno-unused -Wno-pointer-sign -Wno-uninitialized -Wno-switch -Wno-strict-overflow -Wno-main endif ifneq ($(HB_BUILD_OPTIM),no) diff --git a/harbour/config/win/mingw.mk b/harbour/config/win/mingw.mk index 5722c45b24..4004ad5b31 100644 --- a/harbour/config/win/mingw.mk +++ b/harbour/config/win/mingw.mk @@ -36,7 +36,7 @@ endif ifneq ($(HB_BUILD_WARN),no) CFLAGS += -W -Wall else - CFLAGS += -W + CFLAGS += -Wall -Wno-unused -Wno-pointer-sign -Wno-uninitialized -Wno-switch -Wno-strict-overflow -Wno-main endif ifneq ($(HB_BUILD_OPTIM),no) diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 979f5fe7bf..7ca75ba5d5 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -3181,7 +3181,7 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel ) SWITCH hbmk[ _HBMK_nWARN ] CASE _WARN_MAX ; AAdd( hbmk[ _HBMK_aOPTC ], "-W -Wall -pedantic" ) ; EXIT CASE _WARN_YES ; AAdd( hbmk[ _HBMK_aOPTC ], "-W -Wall" ) ; EXIT - CASE _WARN_LOW ; AAdd( hbmk[ _HBMK_aOPTC ], "-W" ) ; EXIT + CASE _WARN_LOW ; AAdd( hbmk[ _HBMK_aOPTC ], "-Wall -Wno-unused -Wno-pointer-sign -Wno-uninitialized -Wno-switch -Wno-strict-overflow -Wno-main" ) ; EXIT CASE _WARN_NO ; AAdd( hbmk[ _HBMK_aOPTC ], "-w" ) ; EXIT ENDSWITCH ENDIF @@ -3427,7 +3427,7 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel ) SWITCH hbmk[ _HBMK_nWARN ] CASE _WARN_MAX ; AAdd( hbmk[ _HBMK_aOPTC ], "-W -Wall -pedantic" ) ; EXIT CASE _WARN_YES ; AAdd( hbmk[ _HBMK_aOPTC ], "-W -Wall" ) ; EXIT - CASE _WARN_LOW ; AAdd( hbmk[ _HBMK_aOPTC ], "-W" ) ; EXIT + CASE _WARN_LOW ; AAdd( hbmk[ _HBMK_aOPTC ], "-Wall -Wno-unused -Wno-pointer-sign -Wno-uninitialized -Wno-switch -Wno-strict-overflow -Wno-main" ) ; EXIT CASE _WARN_NO ; AAdd( hbmk[ _HBMK_aOPTC ], "-w" ) ; EXIT ENDSWITCH cOpt_CompC += " {FC}" @@ -3561,7 +3561,7 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel ) SWITCH hbmk[ _HBMK_nWARN ] CASE _WARN_MAX ; AAdd( hbmk[ _HBMK_aOPTC ], "-W -Wall -pedantic" ) ; EXIT CASE _WARN_YES ; AAdd( hbmk[ _HBMK_aOPTC ], "-W -Wall" ) ; EXIT - CASE _WARN_LOW ; AAdd( hbmk[ _HBMK_aOPTC ], "-W" ) ; EXIT + CASE _WARN_LOW ; AAdd( hbmk[ _HBMK_aOPTC ], "-Wall -Wno-unused -Wno-pointer-sign -Wno-uninitialized -Wno-switch -Wno-strict-overflow -Wno-main" ) ; EXIT CASE _WARN_NO ; AAdd( hbmk[ _HBMK_aOPTC ], "-w" ) ; EXIT ENDSWITCH cOpt_CompC += " {FC}" @@ -3669,7 +3669,7 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel ) SWITCH hbmk[ _HBMK_nWARN ] CASE _WARN_MAX ; AAdd( hbmk[ _HBMK_aOPTC ], "-W -Wall -pedantic" ) ; EXIT CASE _WARN_YES ; AAdd( hbmk[ _HBMK_aOPTC ], "-W -Wall" ) ; EXIT - CASE _WARN_LOW ; AAdd( hbmk[ _HBMK_aOPTC ], "-W" ) ; EXIT + CASE _WARN_LOW ; AAdd( hbmk[ _HBMK_aOPTC ], "-Wall -Wno-unused -Wno-pointer-sign -Wno-uninitialized -Wno-switch -Wno-strict-overflow -Wno-main" ) ; EXIT CASE _WARN_NO ; AAdd( hbmk[ _HBMK_aOPTC ], "-w" ) ; EXIT ENDSWITCH cOpt_CompC += " {FC}"