Bug 47044 - [Patch] apr_snprintf.c compile failure on AIX maintainer_mode with xlc_r v7.0
Summary: [Patch] apr_snprintf.c compile failure on AIX maintainer_mode with xlc_r v7.0
Status: NEW
Alias: None
Product: APR
Classification: Unclassified
Component: APR (show other bugs)
Version: HEAD
Hardware: PC AIX
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2009-04-17 05:26 UTC by Dan Poirier
Modified: 2009-04-17 05:28 UTC (History)
1 user (show)



Attachments
Patch to fix compile error (6.03 KB, patch)
2009-04-17 05:26 UTC, Dan Poirier
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Poirier 2009-04-17 05:26:50 UTC
Created attachment 23503 [details]
Patch to fix compile error

Compile fails on AIX when configured with "--enable-maintainer-mode" and using compiler xlc_r "@(#) IBM XL C/C++ Enterprise Edition V7.0":

"strings/apr_snprintf.c", line 580.31: 1506-1298 (S) The subscript 10 is out of range. The valid range is 0 to 9.

and about a dozen more lines.

The error occurs where the address of an array element past the end of the array is taken.  

Changing the code from &array[LENGTH] to array+LENGTH quiets the compile error, and should be equivalent in function.  With the change it still compiles fine on Linux; haven't tried elsewhere.

Patch attached.