From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 21 04:18:29 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7F09D1A9; Mon, 21 Oct 2013 04:18:29 +0000 (UTC) (envelope-from kaduk@mit.edu) Received: from dmz-mailsec-scanner-5.mit.edu (dmz-mailsec-scanner-5.mit.edu [18.7.68.34]) by mx1.freebsd.org (Postfix) with ESMTP id 25B5A284B; Mon, 21 Oct 2013 04:18:28 +0000 (UTC) X-AuditID: 12074422-b7f5a8e000000a34-58-5264a9e20e9f Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP id 18.19.02612.2E9A4625; Mon, 21 Oct 2013 00:13:22 -0400 (EDT) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id r9L4DMwG023027; Mon, 21 Oct 2013 00:13:22 -0400 Received: from multics.mit.edu (system-low-sipb.mit.edu [18.187.2.37]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r9L4DKTT021969 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 21 Oct 2013 00:13:21 -0400 Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id r9L4DKgj010120; Mon, 21 Oct 2013 00:13:20 -0400 (EDT) Date: Mon, 21 Oct 2013 00:13:19 -0400 (EDT) From: Benjamin Kaduk To: sbruno@freebsd.org Subject: Re: gperf -- #define for if (0) ; else for In-Reply-To: <1382327705.2610.9.camel@localhost> Message-ID: References: <1382327705.2610.9.camel@localhost> User-Agent: Alpine 1.10 (GSO 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNIsWRmVeSWpSXmKPExsUixG6nrvtoZUqQwec/ehbbN/9jtOjpPcHo wOQx49N8lgDGKC6blNSczLLUIn27BK6M4zsPsRd0cVQc+HCCvYFxBlsXIyeHhICJxLKGy+wQ tpjEhXvrgeJcHEIC+xglDvdPZoJwNjJKrOy+ApU5xCRx/+8kRgingVHi/8KVYP0sAtoSG35t YAax2QRUJGa+2Qi2QwRo7rR/dxhBbGYBe4l/bf9ZQGxhAWOJ/rO/WUFsTgEDiZ3zjoDN4RVw kNg37zxYvZCAvsSpmauYQGxRAR2J1funsEDUCEqcnPmEBWKmpcS5P9fZJjAKzkKSmoUktYCR aRWjbEpulW5uYmZOcWqybnFyYl5eapGuqV5uZoleakrpJkZwiLoo7WD8eVDpEKMAB6MSD2+A S0qQEGtiWXFl7iFGSQ4mJVHev8uAQnxJ+SmVGYnFGfFFpTmpxYcYJTiYlUR45ywAyvGmJFZW pRblw6SkOViUxHlvcdgHCQmkJ5akZqemFqQWwWRlODiUJHh1gLEoJFiUmp5akZaZU4KQZuLg BBnOAzScF6SGt7ggMbc4Mx0if4rRmOPf2g/fGDmOvAOSQix5+XmpUuK8KiClAiClGaV5cNNg aeYVozjQc8K8TiBVPMAUBTfvFdAqJqBVGhpJIKtKEhFSUg2MiQcnlm7ZaJm54v4S2X8Z24Tt vySIP7VrYrWs+Nx4Y4rjh3aJzhL7/hdVvCtnZJVGPHFtjdV/YNtrtF+51POT8L3/e//eK9B3 Wlo4+9HbijtpuksNtbKXOX7Med+09Or7x3uj3r1jYje9+ihaZH3eGrWigzIh7HYqD24/2vKO neFJfdrRs29dlViKMxINtZiLihMBsnXebg4DAAA= Cc: "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 04:18:29 -0000 On Sun, 20 Oct 2013, Sean Bruno wrote: > I don't even know why this is a thing in our code base. Its generating > a lot of clang noise due to -Wdangling-else > > /usr/src/gnu/usr.bin/gperf/../../../contrib/gperf/src/search.cc:417:15: > warning: add explicit braces to avoid dangling else [-Wdangling-else] > for (int i3 = imax; i3 >= 0; i3--) > ^ > /usr/src/gnu/usr.bin/gperf/../../../contrib/gperf/src/search.cc:39:22: > note: expanded from macro 'for' > #define for if (0) ; else for > ^ > > I see no reason to continue this and propose the removal of the line in > contrib/gperf/src/search.cc > > 37 > 38 /* Assume ISO C++ 'for' scoping rule. */ > 39 #define for if (0) ; else for StackOverflow (!) [1] suggests that they're a workaround for a bug in old versions of Visual Studio. Someone hand Sean the danish axe, please. -Ben [1] http://stackoverflow.com/questions/984878/what-is-the-possible-use-for-define-for-if-false-else-for