Well, no I won't on the Arduino:
void setup()
{
Serial.begin(115200);
char buf [20];
short int a;
short int b;
long int result;
a = 1400;
b = 1000;
result = a * b;
sprintf (buf, "%d",result);
Serial.println (buf);
}
void loop() { }
Output:
23744
You are confusing the issue by posting code for a different processor.
The "int" type on the Arduino is 16 bits. On other processors it can be 32 bits or 64 bits.
See: C data types - Wikipedia
The type int should be the integer type that the target processor is most efficient working with. This allows great flexibility: for example, all types can be 64-bit. However, several different integer width schemes (data models) are popular. This is because the data model defines how different programs communicate, a uniform data model is used within a given operating system application interface.[3]
On the Arduino, int is 16-bit because the target process or more efficient working with that than 32 bit integers.
Your code above is doing something subtle.
If I replace it with this:
#include<stdio.h>
int main( void )
{
short int a;
short int b;
long int result;
a = 1400;
b = 1000;
result = a * b;
printf ("Sizeof int = %li\n", sizeof (int));
printf("%li \n",result);
return 0;
}
Output (on my Ubuntu PC):
Sizeof int = 4
1400000
The important thing here is that the size of an int is 4 (not 2). Reading the rules on the page I linked above:
Integer types smaller than int are promoted when an operation is performed on them.
So on your Windows/Mac/Ubuntu machine variables a and b are promoted to 32-bit ints. Then they are multiplied. The result fits into 32 bits, so it is not truncated.
On the Arduino there is no promotion to 32 bits, so the results are truncated. This is not the IDE's fault. You need to be aware of the size of the data types on your target machine.