int problem

I am just starting to learn Arduino Programming.

I ran the following simple code in Arduino and expected an error because 'int a' is greater than 32,767 but it verified OK ???

void setup() {

void loop() {
int a =123456789;

Why did it verify ??

under File->Preferences, what are your compiler warnings set to?

C:\stuff\SW\Arduino\_Others\Tst\Tst.ino: In function 'void loop()':
C:\stuff\SW\Arduino\_Others\Tst\Tst.ino:5:10: warning: overflow in implicit constant conversion [-Woverflow]
   int a =123456789;
C:\stuff\SW\Arduino\_Others\Tst\Tst.ino:5:7: warning: unused variable 'a' [-Wunused-variable]
   int a =123456789;
Sketch uses 444 bytes (1%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.

Thank you for your quick reply. My warnings were set to'None'. I changed them to 'Default' and I got an error warning when Verifying.

As I said I am just starting to learn Arduino. I did realise you can control what 'Verify' verifies.
I assumed that Verify means checks all aspects of your code.

Thank you for your help
Regards Frank

Actually, no machine can verify all aspects of your code, because some errors are semantic vs. having invalid syntax in the language. In other words, it can't know what the designer intended, or wanted the program to do. It can only see what the designer did, and determine whether that follows the rules of the language.

   int a =123456789;

is not an error at all on a 64 bit processor which uses 64 bit ints.