[Bug 551] New: gcc warning: assignment discards qualifiers from pointer target type

bugzilla-daemon at bugzilla.netfilter.org bugzilla-daemon at bugzilla.netfilter.org
Tue Feb 27 21:46:35 CET 2007


https://bugzilla.netfilter.org/bugzilla/show_bug.cgi?id=551

           Summary: gcc warning: assignment discards qualifiers from pointer
                    target type
           Product: ulogd
           Version: SVN (please provide t
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ulogd
        AssignedTo: laforge at gnumonks.org
        ReportedBy: morfoh at opensde.org


name is 'const char' but 'ulogd_logfile' is type 'char' which leads to a gcc
compiler warning: assignment discards qualifiers from pointer target type

src/ulogd.c:
-----------snip--------------------------------------------------------------
78 static char *ulogd_logfile = ULOGD_LOGFILE_DEFAULT;
-----------snip--------------------------------------------------------------
725 /* open the logfile */
726 static int logfile_open(const char *name)
727 {   
728         if (name)
729                 ulogd_logfile = name;
-----------snip--------------------------------------------------------------

Following patch seems to fix that issue:
-----------snip--------------------------------------------------------------
--- ./src/ulogd.c.orig  2007-02-27 18:57:22.000000000 +0100
+++ ./src/ulogd.c       2007-02-27 18:58:00.000000000 +0100
@@ -75,7 +75,7 @@
 /* global variables */
 static FILE *logfile = NULL;           /* logfile pointer */
 static char *ulogd_configfile = ULOGD_CONFIGFILE;
-static char *ulogd_logfile = ULOGD_LOGFILE_DEFAULT;
+static const char *ulogd_logfile = ULOGD_LOGFILE_DEFAULT;
 static FILE syslog_dummy;
 
 /* linked list for all registered plugins */
-----------snip--------------------------------------------------------------

-- 
Configure bugmail: https://bugzilla.netfilter.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the netfilter-buglog mailing list