Bugzilla – Attachment 61478 Details for
Bug 139376
compiler issue with OO.o
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
a test case that shows the problem
test.c (text/x-csrc), 997 bytes, created by
Petr Mladek
on 2005-12-20 16:52:30 UTC
(
hide
)
Description:
a test case that shows the problem
Filename:
MIME Type:
Creator:
Petr Mladek
Created:
2005-12-20 16:52:30 UTC
Size:
997 bytes
patch
obsolete
>#include <stdio.h> >#include <stdlib.h> > >/** > * Maximum value of a (void*) - use to indicate the limit of an 'infinite' buffer. > * In fact, buffer sizes must not exceed 2GB so that the difference between > * the buffer limit and the buffer start can be expressed in an int32_t. > * > * The definition of U_MAX_PTR must fulfill the following conditions: > * - return the largest possible pointer greater than base > * - return a valid pointer according to the machine architecture (AS/400, 64-bit, etc.) > * - avoid wrapping around at high addresses > * - make sure that the returned pointer is not farther from base than 0x7fffffff > * > * @param base The beginning of a buffer to find the maximum offset from > * @internal > */ ># define U_MAX_PTR(base) ((void *)(((char *)(base)+0x7fffffff) > (char *)(base) ? ((char *)(base)+0x7fffffff) : (char *)-1)) > >int main() >{ > char *p1=(char*)0xffffa0ec; > char *p2=(char*)U_MAX_PTR(p1); > printf ("p1=%p\n",p1); > printf ("p2=%p\n",p2); > return 0; > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
Attachments on
bug 139376
: 61478