Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Main Page
Related Pages
Topics
Namespaces
Data Structures
Files
File List
Globals
EXTERNAL_HEADERS
RSL
tests
intro
17.names.cpp
Go to the documentation of this file.
1
29
// ISSUE DESCRIPTION:
30
// library headers must privatize all names other than those mandated
31
// by the standard according to 17.4.3.1; this includes formal template
32
// parameters and function arguments shown in the Standard
33
// this test #defines the most common offenders and #includes all
34
// library headers with the expectation that violations will be flagged
35
// as compilation errors
36
37
#include <
rw/_defs.h
>
38
39
#include <
rw_driver.h
>
40
41
42
#ifdef __SUNPRO_CC
43
// included first to work around a SunPro 5.4 bug (PR #26255)
44
# include <
time.h
>
45
#endif
// SunPro
46
47
// include ANSI C headers prior to attempting to induce errors in case
48
// the C library itself contains violations of this rule
49
#include <
assert.h
>
50
#include <
ctype.h
>
51
#include <
errno.h
>
52
#include <
float.h
>
53
54
#ifndef _RWSTD_NO_ISO646_H
55
# include <iso646.h>
56
#endif
57
58
#include <
limits.h
>
59
#include <
locale.h
>
60
#include <
math.h
>
61
#include <
setjmp.h
>
62
#include <
signal.h
>
63
#include <
stdarg.h
>
64
#include <
stddef.h
>
65
#include <
stdio.h
>
66
#include <
stdlib.h
>
67
#include <
string.h
>
68
#include <
time.h
>
69
70
#ifndef _RWSTD_NO_WCHAR_H
71
# include <
wchar.h
>
72
#endif
73
74
#ifndef _RWSTD_NO_WCTYPE_H
75
# include <
wctype.h
>
76
#endif
77
78
// include system headers included by the library
79
#include <fcntl.h>
80
81
#ifdef _WIN32
82
# include <io.h>
83
#else
84
# include <unistd.h>
85
#endif
86
87
#include _RWSTD_SYS_TYPES_H
88
89
#if defined (_RWSTD_SOLARIS_THREADS)
90
# include <synch.h>
91
# include <
thread.h
>
92
#elif defined (_RWSTD_POSIX_THREADS)
93
# include <pthread.h>
94
#elif defined (_RWSTD_DCE_THREADS)
95
# if defined (_RWSTD_NO_DCE_PTHREAD_H)
96
# include <pthread.h>
97
# else
98
# include <dce/pthread.h>
99
# endif
100
#elif defined (_WIN32)
101
# include <windows.h>
102
# if defined (_MSC_VER) && 1400 <= _MSC_VER
103
# include <intrin.h>
104
# endif
// 1400 <= _MSC_VER
105
#endif
106
107
108
// symbols typically used by programmers for local names
109
#define a !ERROR!
110
#define b !ERROR!
111
#define c !ERROR!
112
113
#if !defined (__sgi)
114
// a member of __huge_val in /usr/include/math.h and elsewhere
115
# define d !ERROR!
116
#endif
117
118
#define e !ERROR!
119
#define f !ERROR!
120
#define g !ERROR!
121
122
// gets expanded in macros within #include directives
123
// during the second pass of the preprocessor...
124
// #define h !ERROR!
125
126
#define i !ERROR!
127
#define j !ERROR!
128
#define k !ERROR!
129
#define m !ERROR!
130
#define n !ERROR!
131
#define o !ERROR!
132
#define p !ERROR!
133
#define q !ERROR!
134
#define r !ERROR!
135
#define s !ERROR!
136
#define t !ERROR!
137
#define u !ERROR!
138
#define v !ERROR!
139
#define w !ERROR!
140
#define x !ERROR!
141
#define y !ERROR!
142
#define z !ERROR!
143
144
#define A !ERROR!
145
#define B !ERROR!
146
#define C !ERROR!
147
#define D !ERROR!
148
#define E !ERROR!
149
#define F !ERROR!
150
#define G !ERROR!
151
#define H !ERROR!
152
#define I !ERROR!
153
#define J !ERROR!
154
#define K !ERROR!
155
#define L !ERROR!
156
#define M !ERROR!
157
#define N !ERROR!
158
#define O !ERROR!
159
#define P !ERROR!
160
#define Q !ERROR!
161
#define R !ERROR!
162
#define S !ERROR!
163
#define T !ERROR!
164
#define U !ERROR!
165
#define V !ERROR!
166
#define W !ERROR!
167
#define X !ERROR!
168
#define Y !ERROR!
169
#define Z !ERROR!
170
171
// symbols typically used by programmers for names of class members
172
#define a_ !ERROR!
173
#define b_ !ERROR!
174
#define c_ !ERROR!
175
#define d_ !ERROR!
176
#define e_ !ERROR!
177
#define f_ !ERROR!
178
#define g_ !ERROR!
179
#define h_ !ERROR!
180
#define i_ !ERROR!
181
#define j_ !ERROR!
182
#define k_ !ERROR!
183
#define m_ !ERROR!
184
#define n_ !ERROR!
185
#define o_ !ERROR!
186
#define p_ !ERROR!
187
#define q_ !ERROR!
188
#define r_ !ERROR!
189
#define s_ !ERROR!
190
#define t_ !ERROR!
191
#define u_ !ERROR!
192
#define v_ !ERROR!
193
#define w_ !ERROR!
194
#define x_ !ERROR!
195
#define y_ !ERROR!
196
#define z_ !ERROR!
197
198
#define A_ !ERROR!
199
#define B_ !ERROR!
200
#define C_ !ERROR!
201
#define D_ !ERROR!
202
#define E_ !ERROR!
203
#define F_ !ERROR!
204
#define G_ !ERROR!
205
#define H_ !ERROR!
206
#define I_ !ERROR!
207
#define J_ !ERROR!
208
#define K_ !ERROR!
209
#define L_ !ERROR!
210
#define M_ !ERROR!
211
#define N_ !ERROR!
212
#define O_ !ERROR!
213
#define P_ !ERROR!
214
#define Q_ !ERROR!
215
#define R_ !ERROR!
216
#define S_ !ERROR!
217
#define T_ !ERROR!
218
#define U_ !ERROR!
219
#define V_ !ERROR!
220
#define W_ !ERROR!
221
#define X_ !ERROR!
222
#define Y_ !ERROR!
223
#define Z_ !ERROR!
224
225
#define a1 !ERROR!
226
#define b1 !ERROR!
227
#define c1 !ERROR!
228
#define d1 !ERROR!
229
#define e1 !ERROR!
230
#define f1 !ERROR!
231
#define g1 !ERROR!
232
#define h1 !ERROR!
233
#define i1 !ERROR!
234
#define j1 !ERROR!
235
#define k1 !ERROR!
236
#define m1 !ERROR!
237
#define n1 !ERROR!
238
#define o1 !ERROR!
239
#define p1 !ERROR!
240
#define q1 !ERROR!
241
#define r1 !ERROR!
242
#define s1 !ERROR!
243
#define t1 !ERROR!
244
#define u1 !ERROR!
245
#define v1 !ERROR!
246
#define w1 !ERROR!
247
#define x1 !ERROR!
248
#define y1 !ERROR!
249
#define z1 !ERROR!
250
251
#define a2 !ERROR!
252
#define b2 !ERROR!
253
#define c2 !ERROR!
254
#define d2 !ERROR!
255
#define e2 !ERROR!
256
#define f2 !ERROR!
257
#define g2 !ERROR!
258
#define h2 !ERROR!
259
#define i2 !ERROR!
260
#define j2 !ERROR!
261
#define k2 !ERROR!
262
#define m2 !ERROR!
263
#define n2 !ERROR!
264
#define o2 !ERROR!
265
#define p2 !ERROR!
266
#define q2 !ERROR!
267
#define r2 !ERROR!
268
#define s2 !ERROR!
269
#define t2 !ERROR!
270
#define u2 !ERROR!
271
#define v2 !ERROR!
272
#define w2 !ERROR!
273
#define x2 !ERROR!
274
#define y2 !ERROR!
275
#define z2 !ERROR!
276
277
#define A1 !ERROR!
278
#define B1 !ERROR!
279
#define C1 !ERROR!
280
#define D1 !ERROR!
281
#define E1 !ERROR!
282
#define F1 !ERROR!
283
#define G1 !ERROR!
284
#define H1 !ERROR!
285
#define I1 !ERROR!
286
#define J1 !ERROR!
287
#define K1 !ERROR!
288
#define L1 !ERROR!
289
#define M1 !ERROR!
290
#define N1 !ERROR!
291
#define O1 !ERROR!
292
#define P1 !ERROR!
293
#define Q1 !ERROR!
294
#define R1 !ERROR!
295
#define S1 !ERROR!
296
#define T1 !ERROR!
297
#define U1 !ERROR!
298
#define V1 !ERROR!
299
#define W1 !ERROR!
300
#define X1 !ERROR!
301
#define Y1 !ERROR!
302
#define Z1 !ERROR!
303
304
#define A2 !ERROR!
305
#define B2 !ERROR!
306
#define C2 !ERROR!
307
#define D2 !ERROR!
308
#define E2 !ERROR!
309
#define F2 !ERROR!
310
#define G2 !ERROR!
311
#define H2 !ERROR!
312
#define I2 !ERROR!
313
#define J2 !ERROR!
314
#define K2 !ERROR!
315
#define L2 !ERROR!
316
#define M2 !ERROR!
317
#define N2 !ERROR!
318
#define O2 !ERROR!
319
#define P2 !ERROR!
320
#define Q2 !ERROR!
321
#define R2 !ERROR!
322
#define S2 !ERROR!
323
#define T2 !ERROR!
324
#define U2 !ERROR!
325
#define V2 !ERROR!
326
#define W2 !ERROR!
327
#define X2 !ERROR!
328
#define Y2 !ERROR!
329
#define Z2 !ERROR!
330
331
// symbols beginning with __<N> where is a digit are reserved
332
// by Sun dbx (see PR #30521)
333
#define __2logN !ERROR!
334
335
// symbols reserved by gcc (run `strings cc1plus' from the shell)
336
// see also http://gcc.gnu.org/libstdc++/17_intro/BADNAMES
337
#define __aa !ERROR!
338
#define __aad !ERROR!
339
#define __ad !ERROR!
340
#define __addr !ERROR!
341
#define __adv !ERROR!
342
#define __aer !ERROR!
343
#define __als !ERROR!
344
#define __alshift !ERROR!
345
#define __amd !ERROR!
346
#define __ami !ERROR!
347
#define __aml !ERROR!
348
#define __amu !ERROR!
349
#define __aor !ERROR!
350
#define __apl !ERROR!
351
#define __array !ERROR!
352
#define __ars !ERROR!
353
#define __arshift !ERROR!
354
#define __as !ERROR!
355
#define __bit_and !ERROR!
356
#define __bit_ior !ERROR!
357
#define __bit_not !ERROR!
358
#define __bit_xor !ERROR!
359
#define __call !ERROR!
360
#define __cl !ERROR!
361
#define __cm !ERROR!
362
#define __cn !ERROR!
363
#define __co !ERROR!
364
#define __component !ERROR!
365
#define __compound !ERROR!
366
#define __cond !ERROR!
367
#define __convert !ERROR!
368
#define __delete !ERROR!
369
#define __dl !ERROR!
370
#define __dv !ERROR!
371
#define __eq !ERROR!
372
#define __er !ERROR!
373
#define __ge !ERROR!
374
#define __gt !ERROR!
375
#define __indirect !ERROR!
376
#define __le !ERROR!
377
#define __ls !ERROR!
378
#define __lt !ERROR!
379
380
#ifndef _MSC_VER
381
// MSVC's libc defines __max in <stdlib.h>
382
# define __max !ERROR!
383
#endif
384
385
#define __md !ERROR!
386
#define __method_call !ERROR!
387
#define __mi !ERROR!
388
389
#ifndef _MSC_VER
390
// MSVC's libc defines __min in <stdlib.h>
391
# define __min !ERROR!
392
#endif
393
394
#define __minus !ERROR!
395
#define __ml !ERROR!
396
#define __mm !ERROR!
397
#define __mn !ERROR!
398
#define __mult !ERROR!
399
#define __mx !ERROR!
400
#define __ne !ERROR!
401
#define __negate !ERROR!
402
#define __new !ERROR!
403
#define __nop !ERROR!
404
#define __nt !ERROR!
405
#define __nw !ERROR!
406
#define __oo !ERROR!
407
#define __op !ERROR!
408
#define __or !ERROR!
409
#define __pl !ERROR!
410
#define __plus !ERROR!
411
#define __postdecrement !ERROR!
412
#define __postincrement !ERROR!
413
#define __pp !ERROR!
414
#define __pt !ERROR!
415
#define __rf !ERROR!
416
#define __rm !ERROR!
417
#define __rs !ERROR!
418
#define __sz !ERROR!
419
#define __trunc_div !ERROR!
420
#define __trunc_mod !ERROR!
421
#define __truth_andif !ERROR!
422
#define __truth_not !ERROR!
423
#define __truth_orif !ERROR!
424
// __value is reserved by MSVC 8.0
425
#define __value !ERROR!
426
#define __vc !ERROR!
427
#define __vd !ERROR!
428
#define __vn !ERROR!
429
430
// symbols reserved by the ARM compiler
431
#if !defined (sun) && !defined (__sun) && !defined (__sun__)
432
// MB_CUR_MAX expands to __ctype on SunOS
433
# define __ctype !ERROR!
434
#endif
435
436
#define __ct !ERROR!
437
438
// symbols typically used by C++ library implementations
439
#define Alloc !ERROR!
440
#define Allocator !ERROR!
441
#define alloc !ERROR!
442
#define Arg !ERROR!
443
#define Arg1 !ERROR!
444
#define Arg2 !ERROR!
445
#define adr !ERROR!
446
#define addr !ERROR!
447
#define array !ERROR!
448
#define BidirectionalIter !ERROR!
449
#define BidirectionalIterator !ERROR!
450
#define BinaryPred !ERROR!
451
#define BinaryPredicate !ERROR!
452
#define buf !ERROR!
453
#define buffer !ERROR!
454
#define CHAR !ERROR!
455
#define Char !ERROR!
456
#define charT !ERROR!
457
#define CharT !ERROR!
458
#define cmp !ERROR!
459
#define cnt !ERROR!
460
#define cpt !ERROR!
461
#define comp !ERROR!
462
#define Container !ERROR!
463
#define Compare !ERROR!
464
#define dist !ERROR!
465
#define Dist !ERROR!
466
#define Distance !ERROR!
467
#define finish !ERROR!
468
#define ForwardIter !ERROR!
469
#define ForwardIterator !ERROR!
470
#define found !ERROR!
471
#define fun !ERROR!
472
#define Function !ERROR!
473
#define hint !ERROR!
474
#define gen !ERROR!
475
#define Gen !ERROR!
476
#define Generator !ERROR!
477
#define get_array !ERROR!
478
#define get_slice !ERROR!
479
#define gs !ERROR!
480
#define InputIter !ERROR!
481
#define InputIterator !ERROR!
482
#define index !ERROR!
483
#define INT !ERROR!
484
#define inx !ERROR!
485
#define ipfx !ERROR!
486
#define istrm !ERROR!
487
#define last !ERROR!
488
#define len !ERROR!
489
#define lhs !ERROR!
490
#define line !ERROR!
491
#define lineno !ERROR!
492
#define loc !ERROR!
493
#define LONG !ERROR!
494
#define med !ERROR!
495
#define mesg !ERROR!
496
#define middle !ERROR!
497
#define mode !ERROR!
498
#define msg !ERROR!
499
#define msk !ERROR!
500
#define n !ERROR!
501
#define nchar !ERROR!
502
#define nchars !ERROR!
503
#define neg !ERROR!
504
#define negative !ERROR!
505
#define num !ERROR!
506
#define numb !ERROR!
507
#define off !ERROR!
508
#define offset !ERROR!
509
#define old !ERROR!
510
#define opfx !ERROR!
511
#define os !ERROR!
512
#define ostrm !ERROR!
513
#define Operation !ERROR!
514
#define OutputIter !ERROR!
515
#define OutputIterator !ERROR!
516
#define pf !ERROR!
517
#define Pointer !ERROR!
518
#define pos !ERROR!
519
#define position !ERROR!
520
#define positive !ERROR!
521
#define Pred !ERROR!
522
#define Predicate !ERROR!
523
#define pend !ERROR!
524
#define pending !ERROR!
525
#define ptr !ERROR!
526
#define quant !ERROR!
527
#define RandomAccessIter !ERROR!
528
#define RandomAccessIterator !ERROR!
529
#define Reference !ERROR!
530
#define Result !ERROR!
531
#define res !ERROR!
532
533
// used by std::codecvt_base::result
534
// #define result !ERROR!
535
536
#define rhs !ERROR!
537
#define rlen !ERROR!
538
#define save !ERROR!
539
#define sec !ERROR!
540
#define sl !ERROR!
541
#define sla !ERROR!
542
#define sb !ERROR!
543
#define SCHAR !ERROR!
544
#define Size !ERROR!
545
#define slen !ERROR!
546
#define smanip !ERROR!
547
#define start !ERROR!
548
#define stream !ERROR!
549
#define strm !ERROR!
550
#define sz !ERROR!
551
#define tag !ERROR!
552
#define temp !ERROR!
553
#define tmp !ERROR!
554
#define Tp !ERROR!
555
#define traits !ERROR!
556
#define Traits !ERROR!
557
558
#ifdef _RWSTD_NO_EXT_CXX_0X
559
// required member of reference_wrapper
560
# define type !ERROR!
561
#endif
562
563
#define Type !ERROR!
564
#define UCHAR !ERROR!
565
#define UINT !ERROR!
566
#define ULONG !ERROR!
567
#define ULLONG !ERROR!
568
#define USHRT !ERROR!
569
#define UnaryFunction !ERROR!
570
#define val !ERROR!
571
// value used in type traits
572
// #define value !ERROR!
573
#define var !ERROR!
574
#define way !ERROR!
575
#define which !ERROR!
576
#define xpos !ERROR!
577
578
// verify that the library gracefully handles
579
// the frequently #defined function macros
580
#undef max
581
#define max() !ERROR!
582
#undef min
583
#define min() !ERROR!
584
585
// symbols the DEC cxx compiler/linker/debugger use internally
586
#define __INTER__ !ERROR!
587
#define __bptr !ERROR!
588
#define __control !ERROR!
589
#define __vptr !ERROR!
590
#define __result_pointer !ERROR!
591
#define __result !ERROR!
592
#define __vtbl !ERROR!
593
#define __btbl !ERROR!
594
#define evdw !ERROR!
595
#define __external_destructor_functor_list !ERROR!
596
#define __fn !ERROR!
597
#define __fw !ERROR!
598
#define __init !ERROR!
599
#define __fini !ERROR!
600
601
602
#include <algorithm>
603
#include <bitset>
604
#include <complex>
605
#include <deque>
606
#include <exception>
607
#include <fstream>
608
#include <functional>
609
#include <iomanip>
610
#include <ios>
611
#include <iosfwd>
612
#include <iostream>
613
#include <istream>
614
#include <iterator>
615
#include <limits>
616
#include <list>
617
618
#include <locale>
619
620
// assume <map> isn't #included by any other public header
621
#undef comp
622
#include <map>
623
#define comp !ERROR!
624
625
#include <memory>
626
#include <new>
627
#include <numeric>
628
#include <ostream>
629
630
// assume <queue> isn't #included by any other public header
631
// `c' and `comp' mandated by the standard
632
#undef c
633
#undef comp
634
#include <queue>
635
#define c !ERROR!
636
#define comp !ERROR!
637
638
// assume <set> isn't #included by any other public header
639
// `comp' mandated by the standard
640
#undef comp
641
#include <set>
642
#define comp !ERROR!
643
#include <sstream>
644
645
// assume <stack> isn't #included by any other public header
646
// `c' mandated by the standard
647
#undef c
648
#include <stack>
649
#define c !ERROR!
650
651
#include <stdexcept>
652
#include <streambuf>
653
#include <string>
654
655
#if defined (__SUNPRO_CC) && __SUNPRO_CC <= 0x530
656
// working around a SunPro 5.3 bug (see PR #26025)
657
# undef rhs
658
#endif
// SunPro > 5.3
659
660
#include <typeinfo>
661
662
#define rhs !ERROR!
663
664
#include <utility>
665
666
// assume <valarray> isn't #included by any other public header
667
// `start' mandated by the standard
668
#undef start
669
#include <valarray>
670
#define start !ERROR!
671
#include <vector>
672
673
#ifndef _RWSTD_NO_NEW_HEADER
674
675
#include <cassert>
676
#include <cctype>
677
#include <cerrno>
678
#include <cfloat>
679
680
#ifndef _RWSTD_NO_ISO646_H
681
# include <ciso646>
682
#endif
683
684
#include <climits>
685
#include <clocale>
686
#include <cmath>
687
#include <csetjmp>
688
#include <csignal>
689
#include <cstdarg>
690
#include <cstddef>
691
#include <cstdio>
692
#include <cstdlib>
693
#include <cstring>
694
#include <ctime>
695
696
697
#ifndef _RWSTD_NO_WCHAR_H
698
# include <cwchar>
699
#endif
700
701
#ifndef _RWSTD_NO_WCTYPE_H
702
# include <cwctype>
703
#endif
704
705
#endif
// _RWSTD_NO_NEW_HEADER
706
707
709
static
int
710
run_test
(
int
,
char
**)
711
{
712
// no-op (compile-only test)
713
return
0;
714
}
715
716
718
int
main
(
int
argc,
char
** argv)
719
{
720
return
rw_test
(argc, argv, __FILE__,
721
"lib.intro"
,
722
"checking for namespace pollution"
,
723
run_test
,
724
0, 0);
725
}
run_test
void run_test(const ForwardIterator &dummy, T *, Predicate *pred)
Definition
25.find.first.cpp:275
main
#define main
Definition
BAD_ALLOC_COPY_CTOR.cpp:32
_defs.h
assert.h
ctype.h
errno.h
float.h
limits.h
locale.h
math.h
rw_driver.h
rw_test
_TEST_EXPORT int rw_test(int argc, char *argv[], const char *filename, const char *clause, const char *comment, int(*testfun)(int, char **), const char *optspec,...)
setjmp.h
signal.h
stdarg.h
stddef.h
stdio.h
stdlib.h
string.h
thread.h
time.h
wchar.h
wctype.h
Generated by
1.9.8