[#6669] Why no error is reported when linking applciation which calls exp2f()?

Document created by Aaronwu Employee on Oct 17, 2013
Version 1Show Document
  • View in full screen mode

[#6669] Why no error is reported when linking applciation which calls exp2f()?

Submitted By: Sonic Zhang

Open Date

2011-06-28 07:30:45     Close Date

2011-06-28 23:59:12

Priority:

Medium High     Assignee:

Stuart Henderson

Board:

N/A     Silicon Revision:

Resolution:

Rejected     Fixed In Release:

N/A

Processor:

ALL     

Host Operating System:

toolchain rev.:

gcc 4.3 SVN trunk     kernel rev.:

State:

Closed     Found In Release:

N/A

Is this bug repeatable?:

N/A     

Summary: Why no error is reported when linking applciation which calls exp2f()?

Details:

 

exp2f() is not compiled into uclibc in blackfin toolchain. But when link following application, no error is reported.

 

sample.c

 

#include <math.h>

 

int main(int argc, char *argv[])

{

        exp2f(2.0);

        return 0;

}

 

 

sonic@nine:~/projects/test$ bfin-linux-uclibc-gcc -std=gnu99 sample.c -o sample

 

Follow-ups

 

--- Mike Frysinger                                           2011-06-28 11:30:50

gcc optimizes away constants

 

--- Stuart Henderson                                         2011-06-28 11:30:56

exp2f is a compiler built-in under c99 (and so also gnu99), so should be

available and working.

 

if you compile it as:

bfin-linux-uclibc-gcc -std=c89 sample.c -o sample

 

it should look for it in uclibc and fail as you expect.

 

if that's ok with you, can you close this as rejected?

 

--- Stuart Henderson                                         2011-06-28 11:35:45

interesting.  disregard my reply.

 

--- Sonic Zhang                                              2011-06-28 23:54:53

This problem is solved by defining float f = 2.0; and call exp2f with parameter

f.

Close.

 

--- Mike Frysinger                                           2011-06-28 23:57:55

that usually can lead to optimization away too with -O3.  i tend to use argc to

avoid that.

 

int main(int argc) { return exp2f((float)argc); }

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

No Files Were Found

Attachments

    Outcomes