subversion-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mattias Engdegård <matti...@bredband.net>
Subject Re: [PATCH] fix potentially undefined operation warning
Date Fri, 16 May 2014 19:14:13 GMT
16 maj 2014 kl. 19.24 skrev Andreas Stieger:

> I think he has. Further, the call is to svn__base36toui64() which,  
> if I read correctly, uses the pointer as a return, e.g. in this case  
> it does not matter whether the first parameter was incremented.  
> Never versions of gcc might detect this and not warn?

As far as I can tell from reading C99 6.5.16§1 and 6.5.16.1§3, f(&x, + 
+x) is actually well-defined since the value of the variable being  
incremented isn't being used twice, only its address. (There is a  
sequence point before the actual call; 6.5.2.2§10.) That doesn't mean  
it's good style – the patch is an obvious improvement!


Mime
View raw message