[Cryptography] Other obvious issues being ignored?

Yann Droneaud ydroneaud at opteya.com
Mon Oct 26 11:48:19 EDT 2015


Hi,

Le jeudi 22 octobre 2015 à 02:59 +0000, Peter Gutmann a écrit :
> John-Mark Gurney <jmg at funkthat.com> writes:
> 
> > The problem is the C standard and has nothing to do w/ the C 
> > compilers.  The standard allows the compilers to do these 
> > optimizations, so they are perfectly legal and correct.
> 
> The problem is squarely with the compiler writers.  The C standard is 
> (of necessity, although in some cases it's really just unnecessary
> pedantry) written in a rather generic manner.  One example is around 
> undefined behaviour (UB), where UB is an open-ended escape hatch 
> under which anything is permitted.  For example a compiler that, if 
> it thought an integer overflow was possible in a certain case, 
> reformatted your hard drive, is fully C standards-compliant (UB has 
> been triggered, and the C standard doesn't specify what will happen 
> next).  gcc takes this approach.  That is, it doesn't reformat your
> hard drive because the braindamage is so obvious that people would 
> complain, what it does is produce executable code that's nothing like 
> what the source code indicates.  MSVC takes the common-sense approach 
> and leaves your code intact (apparently icc does too, but I haven't 
> been able to check that).

Can you point us where can we found the MSVC-C standard as I dare to
find the definitive definition of "common-sense" I was looking for when
someone once tell me such could be found in "The Hitch Hicker Guide to
the Galaxy", or was it "non-sense", I dunno.

Anyway, if MSVC promises to interpret C standard in a specific way,
this should be written somewhere as a contract to not break code
relying on such interpretations.

And source codes relying on such interpretation cannot be declared to
be written in C, hence, are no more portable, which is a pity.

Regards.

-- 
Yann Droneaud
OPTEYA



More information about the cryptography mailing list