Frama-C
  • Features
  • Documentation
  • Publications
  • Blog
  • Jobs
  • Contact
  • Download
Blog home
← Debugging Solution to yesterday's quiz →

C99 quiz

Pascal Cuoq - 28th Nov 2012

Here is a convenient one-liner:

int l(unsigned int x) 
{ 
  return *(char*)(float[]){x*x} - 63; 
} 

What does it do on my faithful PowerMac?

The Intel version is not as nice. That's progress for you: *(3+(char*)(float){x*x}) - 63

Pascal Cuoq
28th Nov 2012

← Debugging Solution to yesterday's quiz →

Tags

c99 floating-point skein value ACSL Jessie derived-analysis unspecified-behavior CIL OCaml rant memcpy value-builtins conversions-and-promotions icpc2011 csmith position donut facetious-colleagues slicing CompCert big-round-numbers trail nitrogen link benchmarks rte obviously-terminates cybersecurity linking type-checking developer visitor restrict undefined-behavior rers2012 cfg WP c11 anonymous-arrays zlib metrics collaboration FLT_EVAL_METHOD function-pointers c-reduce Eva gui tutorial open-source-case-studies scripts usability windows-cygwin-wsl docker github ci test Ivette GUI event machdep parsing
Copyright © 2007-2025 Frama-C. All Rights Reserved.
  • Terms Of Use
  • Authors
  • Acknowledgements