mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-31 21:20:33 +00:00
[qfcc] Make anonstruct test robust against pointer math
I noticed that pointer math is currently incorrect in qfcc, but it would be nice for fixing it to not break anonstruct since it is testing something else.
This commit is contained in:
parent
0d784d9ef4
commit
c5400c4581
1 changed files with 4 additions and 4 deletions
|
@ -28,22 +28,22 @@ int main()
|
|||
{
|
||||
anon_t anon;
|
||||
int ret = 0;
|
||||
if (&anon.snafu != &anon.fizzle) {
|
||||
if ((int)&anon.snafu != (int)&anon.fizzle) {
|
||||
printf ("anon union broken: %p %p\n",
|
||||
&anon.snafu, &anon.fizzle);
|
||||
ret |= 1;
|
||||
}
|
||||
if (&anon.snafu - &anon.baz != 1) {
|
||||
if ((int)&anon.snafu - (int)&anon.baz != 1) {
|
||||
printf ("snafu and baz not adjacant: snafu:%p baz:%p\n",
|
||||
&anon.snafu, &anon.baz);
|
||||
ret |= 1;
|
||||
}
|
||||
if (&anon.baz - &anon.bar != 1) {
|
||||
if ((int)&anon.baz - (int)&anon.bar != 1) {
|
||||
printf ("baz and bar not adjacant: baz:%p bar:%p\n",
|
||||
&anon.baz, &anon.bar);
|
||||
ret |= 1;
|
||||
}
|
||||
if (&anon.bar - &anon.id != 1) {
|
||||
if ((int)&anon.bar - (int)&anon.id != 1) {
|
||||
printf ("bar not after id: bar:%p id:%p\n",
|
||||
&anon.bar, &anon.id);
|
||||
ret |= 1;
|
||||
|
|
Loading…
Reference in a new issue