From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.bugs Subject: bug#21953: Eliminate warnings in the emacs-25 release branch Date: Thu, 19 Nov 2015 19:34:07 +0100 Message-ID: References: <081tbn5g02.fsf@fencepost.gnu.org> <564E0708.8090600@yandex.ru> <83a8q998oe.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1141257e6bf90e0524e903ba X-Trace: ger.gmane.org 1447958193 2119 80.91.229.3 (19 Nov 2015 18:36:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Nov 2015 18:36:33 +0000 (UTC) Cc: John Wiegley , dgutov@yandex.ru, Richard Stallman , 21953@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 19 19:36:24 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZzU48-0002LY-QN for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Nov 2015 19:36:17 +0100 Original-Received: from localhost ([::1]:43439 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzU48-0001v2-5F for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Nov 2015 13:36:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzU3y-0001jc-2x for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2015 13:36:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzU3u-0008PK-RA for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2015 13:36:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55480) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzU3u-0008PA-OD for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2015 13:36:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZzU3u-0007yM-Dp for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2015 13:36:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juanma Barranquero Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Nov 2015 18:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21953 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21953-submit@debbugs.gnu.org id=B21953.144795811030515 (code B ref 21953); Thu, 19 Nov 2015 18:36:02 +0000 Original-Received: (at 21953) by debbugs.gnu.org; 19 Nov 2015 18:35:10 +0000 Original-Received: from localhost ([127.0.0.1]:45188 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZzU33-0007w5-26 for submit@debbugs.gnu.org; Thu, 19 Nov 2015 13:35:10 -0500 Original-Received: from mail-lf0-f52.google.com ([209.85.215.52]:34971) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZzU2h-0007ue-S0 for 21953@debbugs.gnu.org; Thu, 19 Nov 2015 13:35:07 -0500 Original-Received: by lfdo63 with SMTP id o63so54094905lfd.2 for <21953@debbugs.gnu.org>; Thu, 19 Nov 2015 10:34:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=RpT9SpWdfT6kv8aVNa4n/hTfNwKEScd+DuFoYhui1Co=; b=lRQ1myLDmykZ4//ssTM40BYS1/5/1WZwXPvQvCvaxvpNx9r9YplYIttaxtzwvCToHI 0lmB0L7F2ldrejQ8pst3LYZYkdvd2HxdEPKUHBJ7GrOjrGaM+kjhDUwB5WqBGgpJVSq/ 2BO+YLPQe6ERN9+GrfX2JnTRK4PmIvchnnpJnmoMdQk0Ar6dfe7halBvi8i2sO96KnaX qhLLwYlElxPZomz7wcmdkxvZMRjMlc6AlgwOB/VE57FmwJ2RfiLcCotMxOYsA9q5m04m nc5W95Y+EDu/YMswX1cuhGknWyg2nZGV7Z36GcAm2IGgXnLUiIXXHsU/fzGO1bT/vNzA VohQ== X-Received: by 10.25.206.203 with SMTP id e194mr3388366lfg.166.1447958086938; Thu, 19 Nov 2015 10:34:46 -0800 (PST) Original-Received: by 10.25.21.198 with HTTP; Thu, 19 Nov 2015 10:34:07 -0800 (PST) In-Reply-To: <83a8q998oe.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:108927 Archived-At: --001a1141257e6bf90e0524e903ba Content-Type: text/plain; charset=UTF-8 On Thu, Nov 19, 2015 at 6:54 PM, Eli Zaretskii wrote: > We can stop worrying about warnings in C: there are none, and a few > people regularly compile with pedantic compiler switches and fix > whatever they flag. At least on Windows, that's not entirely true. I compile with very pedantic switches. I had to add "-Wno-missing-prototypes -Wno-missing-declarations -Wno-redundant-decls -Wno-pointer-sign" to my CFLAGS because of the sheer number of warnings. Even so, I get 322 cases of *"initialization discards 'const' qualifier from pointer target type*", and leaving these aside, also this (# of warns, warning message) 14 assignment discards 'const' qualifier from pointer target type [enabled by default] 14 passing argument 1 of 'w32_getenv' discards 'const' qualifier from pointer target type [enabled by default] 5 return discards 'const' qualifier from pointer target type [enabled by default] 5 function might be possible candidate for 'ms_printf' format attribute [-Wsuggest-attribute=format] 4 pointer of type 'void *' used in arithmetic [-Wpointer-arith] 3 format '%d' expects argument of type 'int', but argument 3 has type 'printmax_t' [-Wformat=] 3 passing argument 1 of 'set_user_model' discards 'const' qualifier from pointer target type [enabled by default] 2 nested extern declaration of '_execvp' [-Wnested-externs] 2 passing argument 2 of 'CreateProcessA' discards 'const' qualifier from pointer target type [enabled by default] 2 format '%d' expects argument of type 'int', but argument 2 has type 'DWORD' [-Wformat=] 2 unused variable 'status' [-Wunused-variable] 2 passing argument 2 of 'otf_features' discards 'const' qualifier from pointer target type [enabled by default] 2 ordered comparison of pointer with integer zero [-Wextra] 2 implicit conversion from 'float' to 'double' when passing argument to function [-Wdouble-promotion] 1 unused variable 'terminal' [-Wunused-variable] 1 'dummy' defined but not used [-Wunused-variable] 1 macro "g_type_init" is not used [-Wunused-macros] 1 unused variable 'st' [-Wunused-variable] 1 macro "NOMINMAX" is not used [-Wunused-macros] 1 nested extern declaration of 'is_slow_fs' [-Wnested-externs] 1 function might be candidate for attribute 'noreturn' [-Wsuggest-attribute=noreturn] 1 variable 'face' set but not used [-Wunused-but-set-variable] 1 'timeout' may be used uninitialized in this function [-Wmaybe-uninitialized] 1 implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion] 1 macro "x_display_info" is not used [-Wunused-macros] 1 macro "OFFSET_TO_RVA" is not used [-Wunused-macros] 1 unused variable 'oldset' [-Wunused-variable] 1 macro "DATAGRAM_CHAN_P" is not used [-Wunused-macros] 1 unused variable 'size' [-Wunused-variable] 1 control reaches end of non-void function [-Wreturn-type] 1 macro "_ANONYMOUS_UNION" is not used [-Wunused-macros] 1 unused variable 'address' [-Wunused-variable] 1 unknown conversion type character 'e' in format [-Wformat=] 1 unused variable 'dpyinfo' [-Wunused-variable] 1 nested extern declaration of 'g_b_init_compare_string_w' [-Wnested-externs] 1 nested extern declaration of '_resetstkoflw' [-Wnested-externs] 1 passing argument 1 of 'find_section' discards 'const' qualifier from pointer target type [enabled by default] 1 passing argument 1 of 'w32_get_rdb_resource' discards 'const' qualifier from pointer target type [enabled by default] 1 unused variable 'n_to_read' [-Wunused-variable] 1 macro "WTMP_FILE" is not used [-Wunused-macros] 1 nested extern declaration of 'mainCRTStartup' [-Wnested-externs] 1 variable 'f' set but not used [-Wunused-but-set-variable] 1 macro "DefaultDepthOfScreen" is not used [-Wunused-macros] 1 macro "RVA_TO_PTR" is not used [-Wunused-macros] 1 macro "gnutls_x509_crt_get_signature" is not used [-Wunused-macros] 1 variable 'ctty' set but not used [-Wunused-but-set-variable] 1 nested extern declaration of 'menubar_selection_callback' [-Wnested-externs] 1 macro "MAX_ENCODED_BYTES" is not used [-Wunused-macros] --001a1141257e6bf90e0524e903ba Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Thu, Nov 19, 2015 at 6:54 PM, Eli Zaretskii <eliz@gnu.org> wrote:

> We ca= n stop worrying about warnings in C: there are none, and a few
> peop= le regularly compile with pedantic compiler switches and fix
> whatev= er they flag.

At least on Windows, that's not = entirely true. I compile with very pedantic switches.

<= div>I had to add "-Wno-mis= sing-prototypes -Wno-missing-declarations -Wno-redundant-decls -Wno-pointer= -sign" to my CFLAGS because of the sheer number of warnings.

Even so, I get 322 cases of "initialization = discards 'const' qualifier from pointer target type", and = leaving these aside, also this (# of warns, warning message)

=
=C2=A014 assignment dis= cards 'const' qualifier from pointer target type [enabled by defaul= t]
=C2=A014 passing ar= gument 1 of 'w32_getenv' discards 'const' qualifier from po= inter target type [enabled by default]
=C2=A0 5 return discards 'const' qualifier from po= inter target type [enabled by default]
=C2=A0 5 function might be possible candidate for 'ms_= printf' format attribute [-Wsuggest-attribute=3Dformat]
=C2=A0 4 pointer of type 'void *&= #39; used in arithmetic [-Wpointer-arith]
=C2=A0 3 format '%d' expects argument of type &= #39;int', but argument 3 has type 'printmax_t' [-Wformat=3D]
=C2=A0 3 passing argumen= t 1 of 'set_user_model' discards 'const' qualifier from poi= nter target type [enabled by default]
=C2=A0 2 nested extern declaration of '_execvp' [-W= nested-externs]
=C2=A0= 2 passing argument 2 of 'CreateProcessA' discards 'const' = qualifier from pointer target type [enabled by default]
=C2=A0 2 format '%d' expects argu= ment of type 'int', but argument 2 has type 'DWORD' [-Wform= at=3D]
=C2=A0 2 unused= variable 'status' [-Wunused-variable]
=C2=A0 2 passing argument 2 of 'otf_features&= #39; discards 'const' qualifier from pointer target type [enabled b= y default]
=C2=A0 2 or= dered comparison of pointer with integer zero [-Wextra]
=C2=A0 2 implicit conversion from 'fl= oat' to 'double' when passing argument to function [-Wdouble-pr= omotion]
=C2=A0 1 unus= ed variable 'terminal' [-Wunused-variable]
=C2=A0 1 'dummy' defined but not used = [-Wunused-variable]
= =C2=A0 1 macro "g_type_init" is not used [-Wunused-macros]=
=C2=A0 1 unused variable = 9;st' [-Wunused-variable]
=C2=A0 1 macro "NOMINMAX" is not used [-Wunused-macros]
=C2=A0 1 nested extern = declaration of 'is_slow_fs' [-Wnested-externs]
=C2=A0 1 function might be candidate for a= ttribute 'noreturn' [-Wsuggest-attribute=3Dnoreturn]
=C2=A0 1 variable 'face' set= but not used [-Wunused-but-set-variable]
=C2=A0 1 'timeout' may be used uninitialized in= this function [-Wmaybe-uninitialized]
=C2=A0 1 implicit conversion from 'float' to '= double' to match other operand of binary expression [-Wdouble-promotion= ]
=C2=A0 1 macro "= ;x_display_info" is not used [-Wunused-macros]
=C2=A0 1 macro "OFFSET_TO_RVA" is n= ot used [-Wunused-macros]
=C2=A0 1 unused variable 'oldset' [-Wunused-variable]
=C2=A0 1 macro "DATAGRAM_C= HAN_P" is not used [-Wunused-macros]
=C2=A0 1 unused variable 'size' [-Wunused-varia= ble]
=C2=A0 1 control = reaches end of non-void function [-Wreturn-type]
=C2=A0 1 macro "_ANONYMOUS_UNION" is n= ot used [-Wunused-macros]
=C2=A0 1 unused variable 'address' [-Wunused-variable]
=C2=A0 1 unknown conversion ty= pe character 'e' in format [-Wformat=3D]
=C2=A0 1 unused variable 'dpyinfo' [-Wun= used-variable]
=C2=A0 = 1 nested extern declaration of 'g_b_init_compare_string_w' [-Wneste= d-externs]
=C2=A0 1 ne= sted extern declaration of '_resetstkoflw' [-Wnested-externs]
=C2=A0 1 passing argument 1= of 'find_section' discards 'const' qualifier from pointer = target type [enabled by default]
=C2=A0 1 passing argument 1 of 'w32_get_rdb_resource' di= scards 'const' qualifier from pointer target type [enabled by defau= lt]
=C2=A0 1 unused va= riable 'n_to_read' [-Wunused-variable]
=C2=A0 1 macro "WTMP_FILE" is not used = [-Wunused-macros]
=C2= =A0 1 nested extern declaration of 'mainCRTStartup' [-Wnested-exter= ns]
=C2=A0 1 variable = 'f' set but not used [-Wunused-but-set-variable]
<= font face=3D"monospace, monospace">=C2=A0 1 macro "DefaultDepthOfScree= n" is not used [-Wunused-macros]
=C2=A0 1 macro "RVA_TO_PTR" is not used [-Wunused= -macros]
=C2=A0 1 macr= o "gnutls_x509_crt_get_signature" is not used [-Wunused-macros]
=C2=A0 1 variable '= ctty' set but not used [-Wunused-but-set-variable]
=C2=A0 1 nested extern declaration of '= ;menubar_selection_callback' [-Wnested-externs]
=C2=A0 1 macro "MAX_ENCODED_BYTES" = is not used [-Wunused-macros]

--001a1141257e6bf90e0524e903ba--