From owner-freebsd-bugs@FreeBSD.ORG Fri Feb 1 13:10:02 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B38D93BC for ; Fri, 1 Feb 2013 13:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id A641B623 for ; Fri, 1 Feb 2013 13:10:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r11DA2fl001110 for ; Fri, 1 Feb 2013 13:10:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r11DA2H9001109; Fri, 1 Feb 2013 13:10:02 GMT (envelope-from gnats) Date: Fri, 1 Feb 2013 13:10:02 GMT Message-Id: <201302011310.r11DA2H9001109@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Gleb Smirnoff Subject: Re: kern/175759: Correct data types for fields of struct qm_trace{} from X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Gleb Smirnoff List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2013 13:10:02 -0000 The following reply was made to PR kern/175759; it has been noted by GNATS. From: Gleb Smirnoff To: Andrey Simonenko Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: kern/175759: Correct data types for fields of struct qm_trace{} from Date: Fri, 1 Feb 2013 17:04:27 +0400 On Fri, Feb 01, 2013 at 01:43:46PM +0200, Andrey Simonenko wrote: A> If QUEUE_MACRO_DEBUG is defined and WARNS >= 4, then a program that A> uses some macro definitions from cannot be built because A> of "warning: assignment discards qualifiers from pointer target type" A> warnings. Can you please provide a sample file? I can reproduce this with simple declaration of TAILQ_HEAD for example, neither with gcc nor clang. A> 1. File name fields should have "const char *" type. Paragraph 6.10.8 of standard says that __FILE__ is "a character string literal". It doesn't say that it can be referenced only by a pointer with const qualifier. However, the proposed change definitely makes sence. A> 2. Line number fields should have "long" or "unsigned long" type, A> considering C99 standard and its values for [U]INT_MAX, __LINE__ A> and #line. Paragraph 6.10.8 of standard says that __LINE__ is "an integer constant". Paragraph 6.4.4.1 on integer constants says that "The type of an integer constant is the first of the corresponding list in which its value can be represented." The corresponding list starts with "int". According to paragraph 6.10.4 line number can't get bigger that 2147483647 (INT_MAX), and this value can be represented by int. Thus, I don't see where standard says that line number should be long. Correct me please, if I am wrong. -- Totus tuus, Glebius.