|
|
1.1 ! root 1: /* The Plum Hall Validation Suite for C ! 2: * Unpublished copyright (c) 1986-1991, Chiron Systems Inc and Plum Hall Inc. ! 3: * VERSION: 4 ! 4: * DATE: 1993-01-01 ! 5: * The "ANSI" mode of this suite corresponds to official ANSI C, X3.159-1989. ! 6: * As per your license agreement, your distribution is not to be moved or copied outside the Designated Site ! 7: * without specific permission from Plum Hall Inc. ! 8: */ ! 9: ! 10: #define LIB_TEST 1 ! 11: #include "defs.h" ! 12: #if !ANSI || !HAS_PROTOTYPES ! 13: #define SKIP41 1 ! 14: #endif ! 15: ! 16: #include "flags.h" ! 17: #ifndef SKIP41 ! 18: #include <stddef.h> ! 19: ! 20: /* ! 21: * 4.1.5 - Common definitions <stddef.h> ! 22: */ ! 23: void d4_1_5() ! 24: { ! 25: char *p, *q; ! 26: struct s1 ! 27: { ! 28: char c; ! 29: int d; ! 30: }; ! 31: #if WIDE_CHARS ! 32: char c1 = 'a'; ! 33: wchar_t w1; ! 34: #endif ! 35: ! 36: Filename = "d41d.c"; ! 37: ! 38: iequals(__LINE__, sizeof(ptrdiff_t), sizeof(p - q)); ! 39: iequals(__LINE__, offsetof(struct s1, c), 0); ! 40: checkthat(__LINE__, offsetof(struct s1, c) < offsetof(struct s1, d)); ! 41: #if WIDE_CHARS ! 42: iequals(__LINE__, sizeof(size_t), sizeof(sizeof(int))); ! 43: checkthat(__LINE__, sizeof(wchar_t) >= sizeof(char)); ! 44: ! 45: /* representation as char must == representation as wchar_t */ ! 46: w1 = (wchar_t)c1; ! 47: iequals(__LINE__, w1, c1); ! 48: c1 = (char)w1; ! 49: iequals(__LINE__, w1, c1); ! 50: p = NULL; ! 51: #endif ! 52: } ! 53: ! 54: #else ! 55: int skp41d = 1; /* must have one def */ ! 56: #endif /* SKIP41 */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.