Previous patch forgot to disable -Wctor-dtor-privacy in the defaults. Here is a new one. I should have tested better before submitting it. :-/
diff -Naur gcc-3.3-3.3.3ds6.orig/debian/README.Debian gcc-3.3-3.3.3ds6/debian/README.Debian --- gcc-3.3-3.3.3ds6.orig/debian/README.Debian 2004-04-29 22:30:19.000000000 -0700 +++ gcc-3.3-3.3.3ds6/debian/README.Debian 2004-04-29 22:43:36.000000000 -0700 @@ -59,6 +59,12 @@ hppa-libjava: Enable libjava support for hppa +wall_no_ctor_dtor_privacy: + Remove -Wctor-dtor-privacy from -Wall + +relax_nonvdtor: + Do not warn if dtor is private and class has no friends + test-summary: add libstdc++-v3's check summary to the test summary diff -Naur gcc-3.3-3.3.3ds6.orig/debian/patches/relax_nonvdtor.dpatch gcc-3.3-3.3.3ds6/debian/patches/relax_nonvdtor.dpatch --- gcc-3.3-3.3.3ds6.orig/debian/patches/relax_nonvdtor.dpatch 1969-12-31 16:00:00.000000000 -0800 +++ gcc-3.3-3.3.3ds6/debian/patches/relax_nonvdtor.dpatch 2004-04-29 22:40:17.000000000 -0700 @@ -0,0 +1,48 @@ +#! /bin/sh -e + +# DP: Do not warn if dtor is private and class has no friends + +dir= +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + dir="$3/" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p0 < $0 + #cd ${dir}gcc && autoconf + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p0 < $0 + #rm ${dir}gcc/configure + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- gcc/cp/class.c.orig 2004-04-29 17:35:20.000000000 -0700 ++++ gcc/cp/class.c 2004-04-29 17:36:56.000000000 -0700 +@@ -5437,7 +5437,17 @@ + + if (warn_nonvdtor && TYPE_POLYMORPHIC_P (t) && TYPE_HAS_DESTRUCTOR (t) + && DECL_VINDEX (TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (t), 1)) == NULL_TREE) +- warning ("`%#T' has virtual functions but non-virtual destructor", t); ++ { ++ tree dtor = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (t), 1); ++ ++ /* Warn only if the dtor is non-private or the class has friends */ ++ if (!TREE_PRIVATE (dtor) || ++ (CLASSTYPE_FRIEND_CLASSES (t) || ++ DECL_FRIENDLIST (TYPE_MAIN_DECL (t)))) ++ { ++ warning ("%#T' has virtual functions but non-virtual destructor", t); ++ } ++ } + + complete_vars (t); + diff -Naur gcc-3.3-3.3.3ds6.orig/debian/patches/wall_no_ctor_dtor_privacy.dpatch gcc-3.3-3.3.3ds6/debian/patches/wall_no_ctor_dtor_privacy.dpatch --- gcc-3.3-3.3.3ds6.orig/debian/patches/wall_no_ctor_dtor_privacy.dpatch 1969-12-31 16:00:00.000000000 -0800 +++ gcc-3.3-3.3.3ds6/debian/patches/wall_no_ctor_dtor_privacy.dpatch 2004-04-30 06:53:25.000000000 -0700 @@ -0,0 +1,48 @@ +#! /bin/sh -e + +# DP: Remove -Wctor-dtor-privacy from -Wall + +dir= +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + dir="$3/" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p0 < $0 + #cd ${dir}gcc && autoconf + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p0 < $0 + #rm ${dir}gcc/configure + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- gcc/c-opts.c.orig 2004-04-29 17:37:08.000000000 -0700 ++++ gcc/c-opts.c 2004-04-29 17:37:32.000000000 -0700 +@@ -721,7 +721,6 @@ + else + { + /* C++-specific warnings. */ +- warn_ctor_dtor_privacy = on; + warn_nonvdtor = on; + warn_reorder = on; + warn_nontemplate_friend = on; +--- gcc/c-common.c.orig 2004-04-30 06:48:15.000000000 -0700 ++++ gcc/c-common.c 2004-04-30 06:48:15.000000000 -0700 +@@ -595,7 +595,7 @@ + /* Nonzero means warn when all ctors or dtors are private, and the class + has no friends. */ + +-int warn_ctor_dtor_privacy = 1; ++int warn_ctor_dtor_privacy = 0; + + /* Nonzero means warn in function declared in derived class has the + same name as a virtual in the base class, but fails to match the diff -Naur gcc-3.3-3.3.3ds6.orig/debian/rules.patch gcc-3.3-3.3.3ds6/debian/rules.patch --- gcc-3.3-3.3.3ds6.orig/debian/rules.patch 2004-04-29 22:30:19.000000000 -0700 +++ gcc-3.3-3.3.3ds6/debian/rules.patch 2004-04-29 22:29:17.000000000 -0700 @@ -18,6 +18,10 @@ gccbug libtool-rpath \ hppa-libffi hppa-libjava \ +ifeq ($(with_cxx),yes) + debian_patches += wall_no_ctor_dtor_privacy relax_nonvdtor +endif + debian_patches += test-summary ifeq ($(with_java),yes)
signature.asc
Description: Digital signature