On Thu, Jun 08, 2017 at 08:53:54AM -0600, Martin Sebor wrote:
> > > I think I'll go with -Wmultistatement-expansion (without the dash).
> >
> > Fine with me, FWIW.
>
> I like this name better, but I think -Wmultistatement-macros
> would be clearer (it also matches the CERT rule).
Ok, I'll buy th
I think I'll go with -Wmultistatement-expansion (without the dash).
Fine with me, FWIW.
I like this name better, but I think -Wmultistatement-macros
would be clearer (it also matches the CERT rule).
Martin
On 06/08/2017 12:19 PM, Marek Polacek wrote:
> On Thu, Jun 08, 2017 at 12:01:03PM +0100, Pedro Alves wrote:
>> On 06/08/2017 11:29 AM, Marek Polacek wrote:
>>> On Wed, Jun 07, 2017 at 08:02:42PM +0100, Pedro Alves wrote:
Hi Marek,
Nice warning! Just to confirm, would the patch warn
On Thu, Jun 08, 2017 at 12:01:03PM +0100, Pedro Alves wrote:
> On 06/08/2017 11:29 AM, Marek Polacek wrote:
> > On Wed, Jun 07, 2017 at 08:02:42PM +0100, Pedro Alves wrote:
> >> Hi Marek,
> >>
> >> Nice warning! Just to confirm, would the patch warn with code like:
> >
> > Thanks. BTW, if you (
On 06/08/2017 11:29 AM, Marek Polacek wrote:
> On Wed, Jun 07, 2017 at 08:02:42PM +0100, Pedro Alves wrote:
>> Hi Marek,
>>
>> Nice warning! Just to confirm, would the patch warn with code like:
>
> Thanks. BTW, if you (or anyone) could come up with a better name,
> I'm all ears.
AFAICS, the w
On Wed, Jun 07, 2017 at 08:02:42PM +0100, Pedro Alves wrote:
> Hi Marek,
>
> Nice warning! Just to confirm, would the patch warn with code like:
Thanks. BTW, if you (or anyone) could come up with a better name,
I'm all ears.
> const char *
> target_xfer_status_to_string (enum target_xfer_st
Hi Marek,
Nice warning! Just to confirm, would the patch warn with code like:
const char *
target_xfer_status_to_string (enum target_xfer_status status)
{
#define CASE(X) case X: return #X
switch (status)
{
CASE(TARGET_XFER_E_IO);
CASE(TARGET_XFER_UNAVAILABLE);
defa
On Fri, Jun 02, 2017 at 03:50:12PM -0600, Martin Sebor wrote:
> On 06/02/2017 10:52 AM, Marek Polacek wrote:
> > On Thu, Jun 01, 2017 at 04:17:24PM -0600, Martin Sebor wrote:
> > > Very nice. I think David already suggested handling other statements
> > > besides if (do/while), so let me just add
On 06/02/2017 10:52 AM, Marek Polacek wrote:
On Thu, Jun 01, 2017 at 04:17:24PM -0600, Martin Sebor wrote:
Very nice. I think David already suggested handling other statements
besides if (do/while), so let me just add for and switch (as in:
'switch (1) case SWAP (i, j);')
How's that one probl
On Thu, Jun 01, 2017 at 04:17:24PM -0600, Martin Sebor wrote:
> Very nice. I think David already suggested handling other statements
> besides if (do/while), so let me just add for and switch (as in:
> 'switch (1) case SWAP (i, j);')
How's that one problematic, though?
> The location in the warn
On Thu, Jun 01, 2017 at 10:13:01PM +, Joseph Myers wrote:
> On Thu, 1 Jun 2017, David Malcolm wrote:
>
> > The patch appears to only consider "if" and "else" clauses. Shouldn't
> > it also cover "for", "while" and "do/while"?
>
> do/while would normally get a syntax error in the problem case
On Thu, Jun 01, 2017 at 02:08:21PM -0400, David Malcolm wrote:
> On Thu, 2017-06-01 at 18:45 +0200, Marek Polacek wrote:
> > A motivating example for this warning can be found e.g. in
> >
> > PRE10-C. Wrap multistatement macros in a do-while loop
> > https://www.securecoding.cert.org/confluenc
On 06/01/2017 10:45 AM, Marek Polacek wrote:
A motivating example for this warning can be found e.g. in
PRE10-C. Wrap multistatement macros in a do-while loop
https://www.securecoding.cert.org/confluence/x/jgL7
i.e.,
#define SWAP(x, y) \
tmp = x; \
x = y; \
y = tmp
used like this [1
On Thu, 1 Jun 2017, David Malcolm wrote:
> The patch appears to only consider "if" and "else" clauses. Shouldn't
> it also cover "for", "while" and "do/while"?
do/while would normally get a syntax error in the problem cases.
--
Joseph S. Myers
jos...@codesourcery.com
On Thu, Jun 01, 2017 at 06:45:17PM +0200, Marek Polacek wrote:
> A motivating example for this warning can be found e.g. in
>
> PRE10-C. Wrap multistatement macros in a do-while loop
> https://www.securecoding.cert.org/confluence/x/jgL7
>
> i.e.,
>
> #define SWAP(x, y) \
> tmp = x; \
>
On Thu, 2017-06-01 at 18:45 +0200, Marek Polacek wrote:
> A motivating example for this warning can be found e.g. in
>
> PRE10-C. Wrap multistatement macros in a do-while loop
> https://www.securecoding.cert.org/confluence/x/jgL7
>
> i.e.,
>
> #define SWAP(x, y) \
> tmp = x; \
> x = y;
A motivating example for this warning can be found e.g. in
PRE10-C. Wrap multistatement macros in a do-while loop
https://www.securecoding.cert.org/confluence/x/jgL7
i.e.,
#define SWAP(x, y) \
tmp = x; \
x = y; \
y = tmp
used like this [1]
int x, y, z, tmp;
if (z == 0)
SWAP(x, y);
17 matches
Mail list logo