[prev in list] [next in list] [prev in thread] [next in thread] 

List:       hurd-bug
Subject:    Re: Warnings about error_t in glibc on GNU/Hurd
From:       Roland McGrath <roland () hack ! frob ! com>
Date:       2013-05-29 22:53:24
Message-ID: 20130529225324.88B1F2C075 () topped-with-meat ! com
[Download RAW message or body]

> I'd suggest to go with the simple ESUCCESS instead of spending some more
> months ;-) thinking about a "more suitable" name.  

That is indisputably reasonable, but I did just find myself spending a few
minutes thinking about what name would be more suitable. ;-)

> +	/* Avoid warning: case value '0' not in enumerated type 'error_t'.  */
> +	ESUCCESS = 0,

I don't think this is the right comment.  If anybody reads this comment at
all, that doesn't tell them much.  Perhaps something like:

/* The value zero always means success and it is perfectly fine for
   code to use 0 explicitly (or implicitly, e.g. via Boolean coercion).
   Having an enum entry for zero both makes the debugger print the name
   for error_t-typed zero values, and prevents the compiler from issuing
   warnings about 'case 0:' in a switch on an error_t-typed value.  */


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic