GNU bug report logs - #17667
[PATCH] df: Initialize a variable to squash a compiler warning

Previous Next

Package: coreutils;

Reported by: Ben Walton <bdwalton <at> gmail.com>

Date: Mon, 2 Jun 2014 15:35:02 UTC

Severity: normal

Tags: patch

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eric Blake <eblake <at> redhat.com>
To: 17667 <at> debbugs.gnu.org, P <at> draigBrady.com, bdwalton <at> gmail.com
Subject: bug#17667: [PATCH] df: Initialize a variable to squash a compiler warning
Date: Mon, 02 Jun 2014 13:55:06 -0600
[Message part 1 (text/plain, inline)]
On 06/02/2014 01:22 PM, Pádraig Brady wrote:

>>          default:
>>            assert (!"bad field_type");
> 
> This is because assert() is not declared __noreturn__ on Solaris 10.

Huh? assert(nonzero) returns normally.  I thought __noreturn__ was
reserved for functions like exit() that really cannot return; assert(0)
does not return, but that does not mean it has the same semantics as
exit().  (Well, technically assert() is a macro, while the __noreturn__
semantics have to be attached to a function invoked by the macro - but
how do you portably determine which function is going to be invoked by
the macro?)

> That can be an important admonition for a compiler
> so I'm wondering should be detect this and provide a __noreturn__ wrapper.

In glibc, it is not assert() that is marked __noreturn__, but the
__assert_fail() internal function call that only gets triggered for
assert(0).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 11 years and 77 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.