[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RP] [PATCH] avoid assigning string constants to char *
From: |
Bernhard R. Link |
Subject: |
Re: [RP] [PATCH] avoid assigning string constants to char * |
Date: |
Tue, 25 Mar 2014 13:04:14 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
* Jérémie Courrèges-Anglas <address@hidden> [140325 11:45]:
> I'm not sure what to think about this patch. A few months ago I went
> the same way, adding const wherever I could. Then I looked at the
> monster diff and found it was either incomplete or useless if it didn't
> bring any benefit (say, no needless data duplication).
One advantage is that it is an easy way to make sure you never run
free() on a string constant.
A other minor advantage is that compiling ratpoison with -Wwrite-strings
no longer produces any warnings. ;-)
Bernhard R. Link
--
F8AC 04D5 0B9B 064B 3383 C3DA AFFC 96D1 151D FFDC