[PATCH 5/7] input: un-constify dev->name
jcristau at debian.org
Thu Jan 30 05:28:25 PST 2014
On Thu, Jan 30, 2014 at 09:48:01 +0100, Hans de Goede wrote:
> On 01/30/2014 12:51 AM, Peter Hutterer wrote:
> > Fallout from fecc7eb1cf66db64728ee2d68cd9443df7e70879, and reverts most of the
> > rest of that patch.
> > The device name is allocated and may even change during PreInit. The const
> > warnings came from the test codes, the correct fix here is to fix the test
> > code.
> > touch.c: In function ‘touch_init’:
> > touch.c:254:14: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
> > dev.name = "test device";
> > Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> Again, please use XNFstrdup instead of strdup sorry for being a PITA about this,
> but IMHO we should always check for malloc errors, rather then ignore them silently.
> Yes they should never happen that is why "tearing the house down" is an ok response
> to malloc errors, ignoring them is not.
> I guess we already have a lot of code getting this wrong, but that is not an excuse
> to add more code getting it wrong.
Again this is in the unit tests, it doesn't matter...
More information about the xorg-devel