[Home]

Summary:ASTERISK-16366: funcs/func_env.c fails to compile because of missing definition for LLONG_MAX in <limits.h>
Reporter:Philip Prindeville (pprindeville)Labels:
Date Opened:2010-07-14 14:00:04Date Closed:2010-07-15 18:39:08
Priority:MajorRegression?Yes
Status:Closed/CompleteComponents:Functions/func_env
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Compilation fails:

i586-linux-uclibc-gcc -o func_env.o -c func_env.c -MD -MT func_env.o -MF .func_env.o.d -MP -pthread -I/home/philipp/kernel/build_i586/asterisk-rHEAD/include -Os -pipe -fomit-frame-pointer -march=k6-2 -fno-align-functions -fno-align-loops -fno-align-jumps -fno-align-labels  -isysroot /home/philipp/kernel/build_i586/staging_dir -isystem /home/philipp/kernel/build_i586/staging_dir/usr/include -D_GNU_SOURCE  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -g3  -O6 -fPIC -DAST_MODULE=\"func_env\"  
func_env.c: In function 'file_read':
func_env.c:467: error: 'LLONG_MAX' undeclared (first use in this function)
func_env.c:467: error: (Each undeclared identifier is reported only once
func_env.c:467: error: for each function it appears in.)
func_env.c: In function 'file_write':
func_env.c:723: error: 'LLONG_MAX' undeclared (first use in this function)
make[2]: *** [func_env.o] Error 1

with gcc 4.2.5 and uclibc-0.9.28
Comments:By: Digium Subversion (svnbot) 2010-07-15 14:46:57

Repository: asterisk
Revision: 276769

U   trunk/configure
U   trunk/configure.ac
U   trunk/include/asterisk/autoconfig.h.in
U   trunk/include/asterisk/compat.h

------------------------------------------------------------------------
r276769 | tilghman | 2010-07-15 14:46:57 -0500 (Thu, 15 Jul 2010) | 5 lines

Define LLONG_MAX on systems that do not have it.

(closes issue ASTERISK-16366)
Reported by: pprindeville

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=276769

By: Philip Prindeville (pprindeville) 2010-07-15 15:07:06

I'm not sure putting the literal:

#define LLONG_MAX 9223372036854775807LL

is the best solution.  What about having:

#define LLONG_MAX ((long long)((~0ULL)>>1))

instead?  That way there's no assumption about the bit width of what a long long is.



By: Tilghman Lesher (tilghman) 2010-07-15 18:39:08

POSIX defines the value given as the minimum acceptable value for LLONG_MAX.  At such time when we need to manipulate files in Asterisk which are larger than 9 quintillion bytes (or even a filesystem that supports larger than 9 exabytes long, you are welcome to reopen this issue.

See http://www.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html