bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vasnprintf.c: Remove some compiler warnings.


From: Paul Eggert
Subject: Re: vasnprintf.c: Remove some compiler warnings.
Date: Mon, 02 Mar 2015 14:35:07 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

Generally speaking the compiler warnings you're talking about cause false alarms so often that they're more trouble than they're worth. For example, if P and Q are pointers into the same array and P <= Q, it's quite normal to compute Q-P and store the result into a size_t variable.

Although I'm not sure why you selected the casts in question to attack first, for casts to unsigned char how about the attached patch instead? The general idea is to avoid casts when possible, as they're too powerful in C. The characters in question are all ASCII so sign extension shouldn't matter.

Attachment: vasnprintf.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]