From: michaelh Date: Sat, 2 Mar 2002 05:54:25 +0000 (+0000) Subject: Turned off an unneeded warning, added X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=a9bceda9d195353293001659e22fd52c176d0fb6;p=fw%2Fsdcc Turned off an unneeded warning, added git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1970 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/support/regression/tests/bug-524209.c b/support/regression/tests/bug-524209.c index fbb0cc45..a5b215e1 100644 --- a/support/regression/tests/bug-524209.c +++ b/support/regression/tests/bug-524209.c @@ -22,7 +22,7 @@ typedef struct _StringBuffer void _scan(StringBuffer *pSB) { - UNUSED(*pSB); + UNUSED(pSB); } void checkCast(void *pIn) diff --git a/support/regression/tests/bug-524211.c b/support/regression/tests/bug-524211.c index 4ec15d89..0dee2d1e 100644 --- a/support/regression/tests/bug-524211.c +++ b/support/regression/tests/bug-524211.c @@ -2,6 +2,9 @@ */ #include +#if 0 +/* Disabled as this only shows a warning */ + typedef unsigned short UINT16; typedef unsigned char UINT8; @@ -24,3 +27,4 @@ const Class Bar = { void foo(void) { } +#endif diff --git a/support/regression/tests/bug-524691.c b/support/regression/tests/bug-524691.c index 542cedcf..a4442382 100644 --- a/support/regression/tests/bug-524691.c +++ b/support/regression/tests/bug-524691.c @@ -19,6 +19,7 @@ static HeapEntryState *_getHeapEntryState(void *p, HeapEntryState *pStates, UINT int iDiff; uMiddle = (uLeft + uRight)/2; + /* A divide by zero is added just before iDiff is assigned */ iDiff = pStates[uMiddle].pBase - p; if (iDiff > 0) @@ -37,3 +38,17 @@ static HeapEntryState *_getHeapEntryState(void *p, HeapEntryState *pStates, UINT return NULL; } + +void +testDivByZero(void) +{ + HeapEntryState aStates[] = { + { (void *)1, 0 } + }; + void *p = (void *)0x1234; + + ASSERT(_getHeapEntryState(p, aStates, 1) == NULL); + + aStates[0].pBase = p; + ASSERT(_getHeapEntryState(p, aStates, 1) == aStates + 0); +}