Blog

StackOverflow answers everything
Pascal Cuoq on 2 October 2012

One thing leading to another, I recently ended up wondering why, according to an individual close to the situation, the C snippet below is considered defined in C99. struct X { int a[5]; } f(); int *p = f().a; printf(\%p" p); The programming Q&A website StackOverflow had never failed me...

Read More

RERS 2012 competition: our solutions for problems 1-9
Pascal Cuoq on 2 October 2012

Previously on this blog Although it was so brief that you may have missed it, I previously mentioned here the 2012 RERS Grey Box Challenge an interesting competition where the questions involve programs in C syntax. I pointed out that some questions were about the reachability of assertions in the...

Read More

A proposal for named constants in C
Pascal Cuoq on 30 September 2012

If you liked my earlier proposal for a finer-grained restrict (1 2 3 4) you might like this slightly more serious proposal for named constants in C on Jens Gustedt's blog. Or not. Here is a simple test to tell if you are likely to be interested: if you can...

Read More

Never forget to sanitize your input
Virgile Prevosto on 19 September 2012

This post is a follow up of this one A facetious colleague pointed out to me that the print_stmt function that is used to display the CFG in the post mentioned above behaves incorrectly when used over code that include string constants such as the one below: void f(const char...

Read More

A value analysis option to reuse previous function analyses
Pascal Cuoq on 6 September 2012

A context-sensitive analysis Frama-C's value analysis is context-sensitive. This means that when a function f2() is called from a caller f1() function f2() is analyzed as many times as the analyzer goes over f1(). Function f2() is analyzed each time with a different program state—the program state corresponding to the...

Read More