This is more of can you verify my results posting.
I primarily use TDM-GCC ( TDM-GCC ) for my needs but I was interested in this
distro package from: MinGW Distro - nuwen.net
I found different results from the snippit below.
An inquiry suggested I contact the MinGW group.
I then tried using a couple different MinGW versions up to and including the new 4.8.0
They all gave the same results -> 1266
I also tested as:
a c++ example using cl from the Win7.1 sdk
a c++ example using the free Borland 5.5
a BASIC version using PowerBASIC and FreeBasic.
PellesC
tcc
All displayed 1267 except for Borland and MinGW
James
source:
Code:
//***************************************************************
#include <stdio.h>
int foo (double);
int main (int,char**);
int foo (double d)
{
printf("%s% .15G\n","d = ",(double)d);
return d*100;
}
int main (int argc,char** argv)
{
int rv={0};
rv= foo( 12.67);
printf("%s% d\n","rv = ",(int)rv);
return 0;
}
//***************************************************************
This is the result of compiling and running using distro mingw-9.6
Code:
C:\bc9Adp\RadAsm\Bc9\Examples\bc9CppExamples>\Mingw\set_distro_paths
C:\bc9Adp\RadAsm\Bc9\Examples\bc9CppExamples>gcc --version
gcc (GCC) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
C:\bc9Adp\RadAsm\Bc9\Examples\bc9CppExamples>gcc rv.c -orv.exe
C:\bc9Adp\RadAsm\Bc9\Examples\bc9CppExamples>rv
d = 12.67
rv = 1266
*********************************************************************************
this is the result from MinGWTDM
Code:
C:\bc9Adp\RadAsm\Bc9\Examples\bc9CppExamples>%MINGW%\bin\gcc --version
gcc (tdm64-1) 4.7.1
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
C:\bc9Adp\RadAsm\Bc9\Examples\bc9CppExamples>%MINGW%\bin\gcc rv.c -orv.exe -m32
C:\bc9Adp\RadAsm\Bc9\Examples\bc9CppExamples>rv
d = 12.67
rv = 1267