diff options
author | Jakob Kaivo <jkk@ung.org> | 2019-03-06 20:10:58 -0500 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2019-03-06 20:10:58 -0500 |
commit | 71e53c2e606d52502210bc5af67706eefcd4c1d4 (patch) | |
tree | 744b91d1890883f13e86331b682b56ba0a7efb3c /stddef.c | |
parent | fadbd0fec14ed74f920a8b37c0f775221dbae2e2 (diff) |
maybe better test for offsetof()
Diffstat (limited to 'stddef.c')
-rw-r--r-- | stddef.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -12,11 +12,13 @@ void test_stddef_h(void) char b; }; + static struct s the_s; + testing_header("stddef.h"); test_true(NULL == 0); - test_int_equals(offsetof(struct s, b), 1); + test_int_equals(offsetof(struct s, b), (char*)&(the_s.b) - (char*)&the_s); testing_end(); } |