summaryrefslogtreecommitdiff
path: root/stddef.c
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-03-06 20:10:58 -0500
committerJakob Kaivo <jkk@ung.org>2019-03-06 20:10:58 -0500
commit71e53c2e606d52502210bc5af67706eefcd4c1d4 (patch)
tree744b91d1890883f13e86331b682b56ba0a7efb3c /stddef.c
parentfadbd0fec14ed74f920a8b37c0f775221dbae2e2 (diff)
maybe better test for offsetof()
Diffstat (limited to 'stddef.c')
-rw-r--r--stddef.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/stddef.c b/stddef.c
index 73f0dfd..c42abf3 100644
--- a/stddef.c
+++ b/stddef.c
@@ -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();
}