Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131108003707.GE1685@port70.net>
Date: Fri, 8 Nov 2013 01:37:07 +0100
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: Re: [PATCH v2] shadow: Implement putspent

* Jens Gustedt <jens.gustedt@...ia.fr> [2013-11-07 23:35:01 +0100]:
> The second variant isn't a cas?? but a conversion and it just checks if
> S is assignment compatible with `char const*`. A completely type safe
> variant then would be
> 
> #define STR(S) ((S) ? (char const*){ (S) } : (char const[]){ 0 })
> 
> which wouldn't imply any conversion. (And which a compiler *may*
> realize by using a static object for the empty string.)

yes but we are talking about a translation unit that
implements a single function with a single fprintf call

fprintf does not modify its arguments so any hackery
around the const qualifier is just clutter

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.