Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Feb 2013 13:43:46 +0200
From:      Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/175759: Correct data types for fields of struct qm_trace{} from <sys/queue.h>
Message-ID:  <20130201114346.GA35697@pm513-1.comsys.ntu-kpi.kiev.ua>
Resent-Message-ID: <201302011150.r11Bo1uX086731@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         175759
>Category:       kern
>Synopsis:       Correct data types for fields of struct qm_trace{} from <sys/queue.h>
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 01 11:50:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Andrey Simonenko
>Release:        FreeBSD 9.1-STABLE amd64
>Organization:
>Environment:
>Description:

If QUEUE_MACRO_DEBUG is defined and WARNS >= 4, then a program that
uses some macro definitions from <sys/queue.h> cannot be built because
of "warning: assignment discards qualifiers from pointer target type"
warnings.

1. File name fields should have "const char *" type.

2. Line number fields should have "long" or "unsigned long" type,
   considering C99 standard and its values for [U]INT_MAX, __LINE__
   and #line.

>How-To-Repeat:
>Fix:
--- queue.h.orig	2012-12-11 21:00:44.000000000 +0200
+++ queue.h	2013-01-31 13:37:13.000000000 +0200
@@ -105,10 +105,10 @@
 #ifdef QUEUE_MACRO_DEBUG
 /* Store the last 2 places the queue element or head was altered */
 struct qm_trace {
-	char * lastfile;
-	int lastline;
-	char * prevfile;
-	int prevline;
+	const char *lastfile;
+	unsigned long lastline;
+	const char *prevfile;
+	unsigned long prevline;
 };
 
 #define	TRACEBUF	struct qm_trace trace;

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130201114346.GA35697>