Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc5658a0

Browse files
committed
Suppress compiler warnings in ecpg test on newer Windows toolchains.
nan_test.pgc supposed that it could unconditionally #define isnan()and isinf() on WIN32. This was evidently copied at some point fromsrc/include/port/win32.h, but nowadays there's a test on _MSC_VERthere. Make nan_test.pgc look the same.Per buildfarm warnings. There's no evidence this produces anythingworse than a warning, and besides it's only a test case, so I don'tfeel a need to back-patch.
1 parent41c16ed commitc5658a0

File tree

3 files changed

+231
-227
lines changed

3 files changed

+231
-227
lines changed

‎src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c

Lines changed: 52 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@
2626

2727

2828
#ifdefWIN32
29+
#if (_MSC_VER<1800)
2930
#defineisinf(x) ((_fpclass(x) == _FPCLASS_PINF) || (_fpclass(x) == _FPCLASS_NINF))
3031
#defineisnan(x) _isnan(x)
32+
#endif
3133
#endif/* WIN32 */
3234

3335
int
@@ -39,54 +41,54 @@ main(void)
3941

4042

4143

42-
#line19 "nan_test.pgc"
44+
#line21 "nan_test.pgc"
4345
intid ;
4446

45-
#line20 "nan_test.pgc"
47+
#line22 "nan_test.pgc"
4648
doubled ;
4749

48-
#line21 "nan_test.pgc"
50+
#line23 "nan_test.pgc"
4951
numeric*num ;
5052

51-
#line22 "nan_test.pgc"
53+
#line24 "nan_test.pgc"
5254
charval [16 ] ;
5355
/* exec sql end declare section */
54-
#line23 "nan_test.pgc"
56+
#line25 "nan_test.pgc"
5557

5658

5759
ECPGdebug(1,stderr);
5860
/* exec sql whenever sqlerror do sqlprint ( ) ; */
59-
#line26 "nan_test.pgc"
61+
#line28 "nan_test.pgc"
6062

6163

6264
{ECPGconnect(__LINE__,0,"ecpg1_regression" ,NULL,NULL ,NULL,0);
63-
#line28 "nan_test.pgc"
65+
#line30 "nan_test.pgc"
6466

6567
if (sqlca.sqlcode<0)sqlprint ( );}
66-
#line28 "nan_test.pgc"
68+
#line30 "nan_test.pgc"
6769

6870

6971
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"create table nantest1 ( id int4 , d float8 )",ECPGt_EOIT,ECPGt_EORT);
70-
#line30 "nan_test.pgc"
72+
#line32 "nan_test.pgc"
7173

7274
if (sqlca.sqlcode<0)sqlprint ( );}
73-
#line30 "nan_test.pgc"
75+
#line32 "nan_test.pgc"
7476

7577
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"insert into nantest1 ( id , d ) values ( 1 , 'nan' :: float8 ) , ( 2 , 'infinity' :: float8 ) , ( 3 , '-infinity' :: float8 )",ECPGt_EOIT,ECPGt_EORT);
76-
#line31 "nan_test.pgc"
78+
#line33 "nan_test.pgc"
7779

7880
if (sqlca.sqlcode<0)sqlprint ( );}
79-
#line31 "nan_test.pgc"
81+
#line33 "nan_test.pgc"
8082

8183

8284
/* declare cur cursor for select id , d , d from nantest1 */
83-
#line33 "nan_test.pgc"
85+
#line35 "nan_test.pgc"
8486

8587
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"declare cur cursor for select id , d , d from nantest1",ECPGt_EOIT,ECPGt_EORT);
86-
#line34 "nan_test.pgc"
88+
#line36 "nan_test.pgc"
8789

8890
if (sqlca.sqlcode<0)sqlprint ( );}
89-
#line34 "nan_test.pgc"
91+
#line36 "nan_test.pgc"
9092

9193
while (1)
9294
{
@@ -97,10 +99,10 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
9799
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
98100
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
99101
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EORT);
100-
#line37 "nan_test.pgc"
102+
#line39 "nan_test.pgc"
101103

102104
if (sqlca.sqlcode<0)sqlprint ( );}
103-
#line37 "nan_test.pgc"
105+
#line39 "nan_test.pgc"
104106

105107
if (sqlca.sqlcode)
106108
break;
@@ -114,34 +116,34 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
114116
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
115117
ECPGt_double,&(d),(long)1,(long)1,sizeof(double),
116118
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EOIT,ECPGt_EORT);
117-
#line45 "nan_test.pgc"
119+
#line47 "nan_test.pgc"
118120

119121
if (sqlca.sqlcode<0)sqlprint ( );}
120-
#line45 "nan_test.pgc"
122+
#line47 "nan_test.pgc"
121123

122124
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"insert into nantest1 ( id , d ) values ( $1 + 6 , $2 )",
123125
ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
124126
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
125127
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
126128
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EOIT,ECPGt_EORT);
127-
#line46 "nan_test.pgc"
129+
#line48 "nan_test.pgc"
128130

129131
if (sqlca.sqlcode<0)sqlprint ( );}
130-
#line46 "nan_test.pgc"
132+
#line48 "nan_test.pgc"
131133

132134
}
133135
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"close cur",ECPGt_EOIT,ECPGt_EORT);
134-
#line48 "nan_test.pgc"
136+
#line50 "nan_test.pgc"
135137

136138
if (sqlca.sqlcode<0)sqlprint ( );}
137-
#line48 "nan_test.pgc"
139+
#line50 "nan_test.pgc"
138140

139141

140142
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"declare cur cursor for select id , d , d from nantest1",ECPGt_EOIT,ECPGt_EORT);
141-
#line50 "nan_test.pgc"
143+
#line52 "nan_test.pgc"
142144

143145
if (sqlca.sqlcode<0)sqlprint ( );}
144-
#line50 "nan_test.pgc"
146+
#line52 "nan_test.pgc"
145147

146148
while (1)
147149
{
@@ -152,10 +154,10 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
152154
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
153155
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
154156
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EORT);
155-
#line53 "nan_test.pgc"
157+
#line55 "nan_test.pgc"
156158

157159
if (sqlca.sqlcode<0)sqlprint ( );}
158-
#line53 "nan_test.pgc"
160+
#line55 "nan_test.pgc"
159161

160162
if (sqlca.sqlcode)
161163
break;
@@ -165,25 +167,25 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
165167
printf("%d NaN '%s'\n",id,val);
166168
}
167169
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"close cur",ECPGt_EOIT,ECPGt_EORT);
168-
#line61 "nan_test.pgc"
170+
#line63 "nan_test.pgc"
169171

170172
if (sqlca.sqlcode<0)sqlprint ( );}
171-
#line61 "nan_test.pgc"
173+
#line63 "nan_test.pgc"
172174

173175

174176
num=PGTYPESnumeric_new();
175177

176178
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"create table nantest2 ( id int4 , d numeric )",ECPGt_EOIT,ECPGt_EORT);
177-
#line65 "nan_test.pgc"
179+
#line67 "nan_test.pgc"
178180

179181
if (sqlca.sqlcode<0)sqlprint ( );}
180-
#line65 "nan_test.pgc"
182+
#line67 "nan_test.pgc"
181183

182184
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"insert into nantest2 ( id , d ) values ( 4 , 'nan' :: numeric )",ECPGt_EOIT,ECPGt_EORT);
183-
#line66 "nan_test.pgc"
185+
#line68 "nan_test.pgc"
184186

185187
if (sqlca.sqlcode<0)sqlprint ( );}
186-
#line66 "nan_test.pgc"
188+
#line68 "nan_test.pgc"
187189

188190

189191
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"select id , d , d from nantest2 where id = 4",ECPGt_EOIT,
@@ -193,39 +195,39 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
193195
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
194196
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
195197
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EORT);
196-
#line68 "nan_test.pgc"
198+
#line70 "nan_test.pgc"
197199

198200
if (sqlca.sqlcode<0)sqlprint ( );}
199-
#line68 "nan_test.pgc"
201+
#line70 "nan_test.pgc"
200202

201203

202204
printf("%d %s '%s'\n",id, (num->sign==NUMERIC_NAN ?"NaN" :"not NaN"),val);
203205

204206
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"insert into nantest2 ( id , d ) values ( 5 , $1 )",
205207
ECPGt_numeric,&(num),(long)1,(long)0,sizeof(numeric),
206208
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EOIT,ECPGt_EORT);
207-
#line72 "nan_test.pgc"
209+
#line74 "nan_test.pgc"
208210

209211
if (sqlca.sqlcode<0)sqlprint ( );}
210-
#line72 "nan_test.pgc"
212+
#line74 "nan_test.pgc"
211213

212214
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"insert into nantest2 ( id , d ) values ( 6 , $1 )",
213215
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
214216
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EOIT,ECPGt_EORT);
215-
#line73 "nan_test.pgc"
217+
#line75 "nan_test.pgc"
216218

217219
if (sqlca.sqlcode<0)sqlprint ( );}
218-
#line73 "nan_test.pgc"
220+
#line75 "nan_test.pgc"
219221

220222

221223
/* declare cur1 cursor for select id , d , d from nantest2 */
222-
#line75 "nan_test.pgc"
224+
#line77 "nan_test.pgc"
223225

224226
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"declare cur1 cursor for select id , d , d from nantest2",ECPGt_EOIT,ECPGt_EORT);
225-
#line76 "nan_test.pgc"
227+
#line78 "nan_test.pgc"
226228

227229
if (sqlca.sqlcode<0)sqlprint ( );}
228-
#line76 "nan_test.pgc"
230+
#line78 "nan_test.pgc"
229231

230232
while (1)
231233
{
@@ -236,35 +238,35 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
236238
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,
237239
ECPGt_char,(val),(long)16,(long)1,(16)*sizeof(char),
238240
ECPGt_NO_INDICATOR,NULL ,0L,0L,0L,ECPGt_EORT);
239-
#line79 "nan_test.pgc"
241+
#line81 "nan_test.pgc"
240242

241243
if (sqlca.sqlcode<0)sqlprint ( );}
242-
#line79 "nan_test.pgc"
244+
#line81 "nan_test.pgc"
243245

244246
if (sqlca.sqlcode)
245247
break;
246248
printf("%d %s '%s'\n",id, (num->sign==NUMERIC_NAN ?"NaN" :"not NaN"),val);
247249
}
248250
{ECPGdo(__LINE__,0,1,NULL,0,ECPGst_normal,"close cur1",ECPGt_EOIT,ECPGt_EORT);
249-
#line84 "nan_test.pgc"
251+
#line86 "nan_test.pgc"
250252

251253
if (sqlca.sqlcode<0)sqlprint ( );}
252-
#line84 "nan_test.pgc"
254+
#line86 "nan_test.pgc"
253255

254256

255257
PGTYPESnumeric_free(num);
256258

257259
{ECPGtrans(__LINE__,NULL,"rollback");
258-
#line88 "nan_test.pgc"
260+
#line90 "nan_test.pgc"
259261

260262
if (sqlca.sqlcode<0)sqlprint ( );}
261-
#line88 "nan_test.pgc"
263+
#line90 "nan_test.pgc"
262264

263265
{ECPGdisconnect(__LINE__,"CURRENT");
264-
#line89 "nan_test.pgc"
266+
#line91 "nan_test.pgc"
265267

266268
if (sqlca.sqlcode<0)sqlprint ( );}
267-
#line89 "nan_test.pgc"
269+
#line91 "nan_test.pgc"
268270

269271

270272
return (0);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp