Done, files as: 3568250

On Sep 16, 2012, at 5:48 PM, Peter Bigot wrote:

> There is no double (64-bit) support in the mspgcc toolchain, only
> float (32-bit), with double being equivalent.  While most math
> libraries have both float and double entrypoints (e.g., sin() is
> simply a wrapper around sinf()), it appears log() only exists as
> logf().  Please file this as a bug on the tracker, but it won't be
> high priority since it appears to have always been this way.
> 
> Since double isn't supported, it's probably best to not use it, rather
> than mislead the maintainer into thinking it's actually available.
> Use "float", and then use the corresponding functions like "logf".
> 
> Peter
> 
> On Sun, Sep 16, 2012 at 7:45 PM, Robert Wessels <robertin...@yahoo.com> wrote:
>> My command line is: msp430-gcc -mmcu=msp430g2553 main.c -o foo.elf -lm
>> Note -lm needs to be after the .c files to be picked up..
>> 
>> This results in:
>> 
>> /var/folders/_2/jkjmx9g52rld63ptzv1j4w4h0000gn/T//ccUsXLlr.o: In function 
>> `main':
>> main.c:(.init9+0x14): undefined reference to `log'
>> collect2: ld returned 1 exit status
>> 
>> If I replace log() with logf() then it links OK. If -lm is omitted in the 
>> logs case a similar error is thrown by the compiler indicating the -lm was 
>> picked up correctly and thus log() should have worked too.
>> 
>> Robert
>> 
>> On Sep 16, 2012, at 4:35 PM, Robert Wessels wrote:
>> 
>>> One of the Energia users stumbled upon what seems to be a bug.
>>> The following compiles just fine.
>>> 
>>> #include <msp430.h>
>>> #include <math.h>
>>> 
>>> unsigned int foo = 0;
>>> int main()
>>> {
>>>   double var = log(1024);
>>>   var++;
>>> }
>>> 
>>> This piece of code however gives:
>>> 
>>> main.o: In function `main':
>>> /Users/rwessels/tmp/log_bug/main.c:9: undefined reference to `log'
>>> collect2: ld returned 1 exit status
>>> make: *** [null.elf] Error 1
>>> 
>>> 
>>> #include <msp430.h>
>>> #include <math.h>
>>> 
>>> unsigned int foo = 0;
>>> int main()
>>> {
>>>   double var = log(foo);
>>>   var++;
>>> }
>>> 
>>> Seems that log() does not like variables.
>>> 
>>> Robert
>>> 
>> 
>> 
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Mspgcc-users mailing list
>> Mspgcc-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/mspgcc-users


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to