Show
Ignore:
Timestamp:
04/03/07 09:47:33 (22 months ago)
Author:
codehelp
Message:

enabling compiler warnings

Location:
current/host/trunk/empath/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • current/host/trunk/empath/trunk/README

    r670 r920  
    88The previous hack is no longer needed, just run: 
    99./autogen.sh 
    10 ./configure 
     10./configure --enable-compile-warnings --enable-error-on-warning 
    1111make 
    12 svn-buildpackage 
     12svn-buildpackage -uc -us -rfakeroot 
    1313 
    1414Don't forget to update the manpage: 
  • current/host/trunk/empath/trunk/configure.ac

    r669 r920  
    6969dnl ************************************* 
    7070AC_MSG_CHECKING(what extra warning flags to pass to the C compiler) 
     71warnFLAGS= 
     72set_compile_warnings=no 
     73AC_ARG_ENABLE(compile-warnings, 
     74              [  --enable-compile-warnings 
     75                          Enable verbose compiler warnings], 
     76              set_compile_warnings=yes) 
     77 
     78if test "$set_compile_warnings" != "no"; then 
     79warnFLAGS="${warnFLAGS} -Wcast-align -Winline -Wsign-compare -Wpointer-arith" 
     80fi 
    7181if test ${GCC}x = yesx; then 
    72   warnFLAGS= 
    73   CFLAGS="${CFLAGS} -g2 -Wall" 
     82  CXXFLAGS="${CXXFLAGS} -g2 -Wall" 
    7483  AC_ARG_ENABLE(error-on-warning, 
    7584        [  --disable-error-on-warning    disable treating compile warnings as errors], 
     
    8089        esac], 
    8190        [  warnFLAGS="${warnFLAGS} -Werror" ]) 
    82   GCC_VERSION=`${CC} -dumpversion` 
    83   if test `echo ${GCC_VERSION} | cut -d. -f1` -ge 3; then 
    84      # This is gcc >= 3.x.x 
    85      if test `echo ${GCC_VERSION} | cut -d. -f2` -ge 4; then 
    86         # This is gcc >= 3.4.x 
    87         warnFLAGS="${warnFLAGS} -Wdeclaration-after-statement" 
    88      else if test `echo ${GCC_VERSION} | cut -d. -f1` -ge 4; then 
    89         # This is gcc == 4.x.x 
    90         warnFLAGS="${warnFLAGS} -Wdeclaration-after-statement -Wno-pointer-sign" 
    91         LDFLAGS="${LDFLAGS} -Wl,--as-needed" 
    92         fi 
    93      fi 
    94      else if test `echo ${GCC_VERSION} | cut -d. -f1` -ge 4; then 
    95         # This is gcc == 4.x.x 
    96         warnFLAGS="${warnFLAGS} -Wdeclaration-after-statement -Wno-pointer-sign" 
    97     fi 
    98   fi 
     91  CXXFLAGS="$CXXFLAGS ${warnFLAGS}" 
    9992  CFLAGS="${CFLAGS} ${warnFLAGS}" 
    10093else 
     
    10295fi 
    10396AC_MSG_RESULT($warnFLAGS) 
    104  
    105 set_compile_warnings=no 
    106  
    107 AC_ARG_ENABLE(compile-warnings, 
    108               [  --enable-compile-warnings 
    109                           Enable verbose compiler warnings], 
    110               set_compile_warnings=yes) 
    111  
    112 if test "$GCC" = "yes" -a "$set_compile_warnings" != "no"; then 
    113         CFLAGS="$CFLAGS -Wcast-align -Wbad-function-cast \ 
    114  -Wstrict-prototypes -Wmissing-declarations -Winline -Wsign-compare \ 
    115  -Wmissing-prototypes -Wnested-externs -Wpointer-arith" 
    116 fi 
    11797 
    11898case "$host" in 
  • current/host/trunk/empath/trunk/src/aptcache.cc

    r919 r920  
    6565static GHashTable * srctree = NULL; 
    6666static gint c = 0; 
    67 static GList * ignore = NULL; 
    6867static GList * sorted_list = NULL; 
    6968static GHashTable * level_hash = NULL; 
     
    131130        sorted_list = g_list_sort (sorted_list, list_compare); 
    132131        fprintf (stdout, "%s\n", _("The following packages are ignored:")); 
    133         for (;sorted_list != NULL;sorted_list->next) 
    134         { 
    135                 fprintf (stdout, "%s\n", sorted_list->data); 
    136                 sorted_list = sorted_list->next; 
     132        for (GList * b = sorted_list; b != NULL; b = b->next) 
     133        { 
     134                fprintf (stdout, "%s\n", (gchar*)b->data); 
    137135        } 
    138136} 
     
    141139output_zero (gpointer key) 
    142140{ 
    143         fprintf (stdout, "%s '%s'", _("Package"), key); 
     141        fprintf (stdout, "%s '%s'", _("Package"), (gchar*)key); 
    144142        fprintf (stdout, "%s\n", 
    145143                _(" can be cross-built from the current base set.")); 
     
    234232        if (Fetcher.Run() == pkgAcquire::Failed) 
    235233                return FALSE; 
     234        return TRUE; 
    236235} 
    237236 
     
    240239{ 
    241240        gchar * URI, * Dist, *Section; 
    242         gboolean IsSrc; 
    243241        gchar ** components; 
    244242 
     
    273271apt_init (const gchar * arch, gboolean debug_on) 
    274272{ 
    275         gchar * pkg, *home; 
    276         guint ScreenWidth = 80 - 1; /* - 1 for the cursor */ 
     273        gchar *home; 
    277274        MMap *Map = 0; 
    278         gboolean All = _config->FindB("APT::Cache::AllNames","false"); 
     275//      gboolean All = _config->FindB("APT::Cache::AllNames","false"); 
    279276 
    280277        /** \todo run update_cache if a marker is older than 24hrs? */ 
     
    361358{ 
    362359        g_return_if_fail (package); 
    363         fprintf (stdout, _("Reading dependencies"), " ."); 
     360        fprintf (stdout, "%s %s", _("Reading dependencies"), " ."); 
    364361        fflush (stdout); 
    365362        check_depends (package, debug_on); 
     
    393390{ 
    394391        EmDepend * iter = NULL; 
    395         GList * check = NULL; 
    396392 
    397393        if (aptcache_lookup(pkgname))