I thing it should generate a warning. but it doesn't. C51 COMPILER V8.16 Compiler settings: level=2
#include<something.h>
my_strange_global_variable = 1;
void main(void) { ...; }
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
So how can you make your assertion that Keil should give a warning!
There are very few Warnings that are mandated by the standards - it is generally just a choice of the particular compiler to give a warning or not. Obviously, different compilers make different choices.
If you really want to catch (potential) problems like this, you should be using a static analyser; eg, Lint
"Give me some links that proves there is one dominating 'standard'"
The standards are the ISO standards (formerly ANSI); the standards supported by Keil are listed here:
http://www.keil.com/product/isoansi.asp
Yes, I know all of that. I just wanted to point out your evasive and selfprotective answers.
Your first answer should be "I have no idea why our compiler doesn't support every standard rule, take it as it is"
And thats's what I said. I just accept it.
When talking about standard definitions: Please define what you mean by "why our compiler".
You do realize that this is a forum for end users, and that Keil staff _may_ read some of the posts?
"...every compiler I know acts differently on that code..."
With that little amount of code, there would be very few possible ways for a compiler to treat it.
Can only assume you've only actually tried it on precious few compilers.
Thank you for reminding me that. I'm a little bit nervous because of hazy answers I get.
I'm a little bit nervous because of hazy answers I get.
The answers you got were razor sharp. You are the one the provided inadequate information!
How is that?