[Home]

Summary:ASTERISK-14053: [patch] armv5tel: ast_expr2.c op_func.c implicit declerations
Reporter:Tzafrir Cohen (tzafrir)Labels:
Date Opened:2009-05-02 10:15:51Date Closed:2009-09-16 18:18:18
Priority:MinorRegression?No
Status:Closed/CompleteComponents:General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20090916__issue15017.diff.txt
( 1) arm_trunk_config_funcs.log
Description:# uname -a
Linux watt 2.6.30-rc2 #3 PREEMPT Fri Apr 24 01:50:30 UTC 2009 armv5tel GNU/Linux

ast_expr2.y: In function 'op_func':
ast_expr2.y:802: warning: implicit declaration of function 'cosl'
ast_expr2.y:802: warning: incompatible implicit declaration of built-in function 'cosl'
ast_expr2.y:813: warning: implicit declaration of function 'sinl'
ast_expr2.y:813: warning: incompatible implicit declaration of built-in function 'sinl'
ast_expr2.y:824: warning: implicit declaration of function 'tanl'
ast_expr2.y:824: warning: incompatible implicit declaration of built-in function 'tanl'
ast_expr2.y:835: warning: implicit declaration of function 'acosl'
ast_expr2.y:835: warning: incompatible implicit declaration of built-in function 'acosl'
ast_expr2.y:846: warning: implicit declaration of function 'asinl'
ast_expr2.y:846: warning: incompatible implicit declaration of built-in function 'asinl'
ast_expr2.y:857: warning: implicit declaration of function 'atanl'
ast_expr2.y:857: warning: incompatible implicit declaration of built-in function 'atanl'
ast_expr2.y:869: warning: implicit declaration of function 'atan2l'
ast_expr2.y:869: warning: incompatible implicit declaration of built-in function 'atan2l'
ast_expr2.y:881: warning: implicit declaration of function 'powl'
ast_expr2.y:881: warning: incompatible implicit declaration of built-in function 'powl'
ast_expr2.y:892: warning: implicit declaration of function 'sqrtl'
ast_expr2.y:892: warning: incompatible implicit declaration of built-in function 'sqrtl'
ast_expr2.y:903: warning: implicit declaration of function 'floorl'
ast_expr2.y:903: warning: incompatible implicit declaration of built-in function 'floorl'
ast_expr2.y:914: warning: implicit declaration of function 'ceill'
ast_expr2.y:914: warning: incompatible implicit declaration of built-in function 'ceill'
ast_expr2.y:925: warning: implicit declaration of function 'roundl'
ast_expr2.y:925: warning: incompatible implicit declaration of built-in function 'roundl'
ast_expr2.y:936: warning: implicit declaration of function 'rintl'
ast_expr2.y:936: warning: incompatible implicit declaration of built-in function 'rintl'
ast_expr2.y:947: warning: implicit declaration of function 'truncl'
ast_expr2.y:947: warning: incompatible implicit declaration of built-in function 'truncl'
ast_expr2.y:958: warning: implicit declaration of function 'expl'
ast_expr2.y:958: warning: incompatible implicit declaration of built-in function 'expl'
ast_expr2.y:969: warning: implicit declaration of function 'exp2l'
ast_expr2.y:969: warning: incompatible implicit declaration of built-in function 'exp2l'
ast_expr2.y:980: warning: implicit declaration of function 'exp10l'
ast_expr2.y:980: warning: incompatible implicit declaration of built-in function 'exp10l'
ast_expr2.y:991: warning: implicit declaration of function 'logl'
ast_expr2.y:991: warning: incompatible implicit declaration of built-in function 'logl'
ast_expr2.y:1002: warning: implicit declaration of function 'log2l'
ast_expr2.y:1002: warning: incompatible implicit declaration of built-in function 'log2l'
ast_expr2.y:1013: warning: implicit declaration of function 'log10l'
ast_expr2.y:1013: warning: incompatible implicit declaration of built-in function 'log10l'
ast_expr2.y: In function 'op_rem':
ast_expr2.y:1526: warning: implicit declaration of function 'fmodl'
ast_expr2.y:1526: warning: incompatible implicit declaration of built-in function 'fmodl
Comments:By: Jason Parker (jparker) 2009-08-21 17:17:55

I don't know if anybody else would be able to reproduce this to test a fix.  I assume a Makefile somewhere just needs a -lm.  Thoughts?  What should we do here?

By: Tilghman Lesher (tilghman) 2009-08-22 08:55:31

These warnings don't have anything to do with the lack of inclusion of a library, but rather the lack of a particular header.  Given that we don't have this warning on other Linux boxes, it is likely that on this particular architecture, the prototypes for those functions are located in a non-standard place.  Given that we don't have access to that system, it is up to the reporter to tell us in which header those prototypes live.

By: Tilghman Lesher (tilghman) 2009-09-01 19:10:33

Thank you for the bug report however this report lacks information we need to investigate it further. For this reason, we are now going to close the bug - please feel free to reopen when you have more information at hand.

In addition, further information can be found at http://www.asterisk.org/developers/bug-guidelines


By: Tzafrir Cohen (tzafrir) 2009-09-14 00:25:43

The problem is that some functions that are tested with AC_CHECK_FUNCS() don't get properly dewtected as missing.

Here is part of config.log:

configure:16752: checking for exp2l
configure:16808: gcc -o conftest -g -O2   conftest.c -lm  >&5
conftest.c:157: warning: conflicting types for built-in function 'exp2l'
configure:16814: $? = 0
configure:16832: result: yes

I attach a larger part of it. Note in the end a certain function that is not detected.

Edited: just to point to the relevant part of configure.ac:

AC_CHECK_FUNCS([exp2l log2l exp10l log10l sinl cosl tanl asinl acosl atanl atan2l powl sqrtl rintl expl logl remainderl fmodl roundl truncl floorl ceill exp2 log2 exp10 log10 sin cos tan asin acos atan atan2 pow rint exp log remainder fmod round trunc floor ceil])



By: Tilghman Lesher (tilghman) 2009-09-15 14:32:24

That only says that there are conflicting types NOT that the function is missing.  Again, you need to figure out in which HEADER FILE these functions are located.

By: Tzafrir Cohen (tzafrir) 2009-09-15 19:32:24

AC_CHECK_FUNCS is a test that technically checks if the symbol is available. Not if it is available in any header.

And indeed:

$ cat /tmp/math.c
#include <math.h>

int main() {
       return (int)fmodl(1, 2);
}

# on amd64:
$  gcc -o conftest -g -O2   /tmp/math.c -lm
(works fine)

# On armel:
$ gcc -o conftest -g -O2   /tmp/math.c -lm
/tmp/math.c: In function ‘main’:
/tmp/math.c:4: warning: incompatible implicit declaration of built-in function ‘fmodl’
(Gives a compile-time warning but links just fine.

fmodl is not available on armel because __NO_LONG_DOUBLE_MATH is set there (at least in glibc-2.7).

nm shows, however, that the symbol is available libm.so in both systems:

# amd64:
$  nm -D /lib/libm.so.6 | grep log10
0000000000028980 T __clog10
0000000000034350 T __clog10f
000000000003ca10 T __clog10l
0000000000028980 W clog10
0000000000034350 W clog10f
000000000003ca10 W clog10l
00000000000258a0 W log10
00000000000311c0 W log10f
0000000000039b10 W log10l

# armel:
$ nm -D /lib/libm.so.6 | grep log10
00051b08 T __clog10
0005eee4 T __clog10f
00051b08 T __clog10l
00051b08 W clog10
0005eee4 W clog10f
00051b08 W clog10l
0004dae8 W log10
0005bf34 W log10f
0004dae8 W log10l

By: Tilghman Lesher (tilghman) 2009-09-16 10:41:48

Despite the C99 requirements, this patch should fix the warnings you're seeing.

By: Tzafrir Cohen (tzafrir) 2009-09-16 17:05:47

Works well.

By: Digium Subversion (svnbot) 2009-09-16 18:18:17

Repository: asterisk
Revision: 219007

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

------------------------------------------------------------------------
r219007 | tilghman | 2009-09-16 18:15:43 -0500 (Wed, 16 Sep 2009) | 7 lines

Detect whether we actually have the long double type, before looking for those functions.
(closes issue ASTERISK-14053)
Reported by: tzafrir
Patches:
      20090916__issue15017.diff.txt uploaded by tilghman (license 14)
Tested by: tzafrir

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

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