Sample Program
On-Line Demonstrations of FlexeLint and PC-lint (aka FlexeLint for Windows)
Bug of the Month for Apr 2009
Bug of the Month Samples
With one compiler this prints 12, 12 and with another it prints 13, 13. Neither compiler issues a complaint. What's wrong?
Modify this example, if desired, and then hit the Analyse Code button
#include
int &f( int k ) { static int &r = k; return r; } int main() { int &a = f( 12 ); int &b = f( 13 ); printf( "a = %d, b = %d\n", a, b ); return 0; }
Run FlexeLint on Bug of the Month Samples
Home
|
Examples
|
Contact
|
Order
PC-lint and FlexeLint are trademarks of Gimpel Software
Copyright © 2009, Gimpel Software