Fix MSVC warning in compat_informix/rnull.pgc
authorAndres Freund <[email protected]>
Wed, 31 Aug 2022 16:31:22 +0000 (09:31 -0700)
committerAndres Freund <[email protected]>
Wed, 31 Aug 2022 16:31:22 +0000 (09:31 -0700)
Building the ecpg tests with MSVC, with warnings enabled, results in the
following warning:
src/interfaces/ecpg/test/compat_informix/rnull.pgc(19,1): warning C4305: 'initializing': truncation from 'double' to 'float'

The more obvious fix would be an 'f' suffix, but ecpg can't parse that.

Reviewed-by: Peter Eisentraut <[email protected]>
Discussion: https://postgr.es/m/2180a97c-c026-1b6c-cec8-d6e499f97017@enterprisedb.com

src/interfaces/ecpg/test/compat_informix/rnull.pgc
src/interfaces/ecpg/test/expected/compat_informix-rnull.c

index a6ad35e3bc93fb94f38434b0aa24f03ab1ee381a..232629fcd4a2145ad0eddfba08a0fb1d75b22d74 100644 (file)
@@ -16,7 +16,7 @@ int main(void)
        $short s = 17;
        $int i = -74874;
        $bool b = 1;
-       $float f = 3.71;
+       $float f = (float) 3.71;
        $long l = 487444;
        $double dbl = 404.404;
        $decimal dec;
index d7ba69c1fbf486f714826dd62952c0fbd44278bb..3efb2be117b681c83525822c0a5326aa0163bc5f 100644 (file)
@@ -58,7 +58,7 @@ int main(void)
 
        
 #line 19 "rnull.pgc"
- float f = 3.71 ;
+ float f = ( float ) 3.71 ;
 
 #line 19 "rnull.pgc"