unsigned long long int data type not supported

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

I am working on ATSAML22N18A CPU and using ASF stack. It is giving warning for unsigned long long int variables. i.e. "ISO C90 doesn't support unsigned long long"

 

Please suggest to add support for unsigned long long int data type.

 

Thanks,

Warm Regards,

Nilesh.

Nilesh

Last Edited: Fri. Aug 4, 2017 - 11:53 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Perhaps you need to use a later C standard? Maybe try -std=c99 or -std=gnu99 ?

 

BTW isn't the int in "long long int" a bit superfluous?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

Thanks for speedy reply.

 

by default -std=gnu99 is set in compiler settings.  I tried using C99 as well. But no success.

 

Plz find attached images also. 

 

Thanks,

Nilesh

Attachment(s): 

Nilesh

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I tried the same thing in the AVR version of GCC:

unsigned long long int foo;

which compiled without error:

C:\SysGCC\avr\bin>avr-gcc -mmcu=atmega16 -Os avr.c -o avr.elf

C:\SysGCC\avr\bin>

in fact even if I tried:

C:\SysGCC\avr\bin>avr-gcc -mmcu=atmega16 -std=c89 -Os avr.c -o avr.elf

it generated no error. So it does seem a little curious that the ARM compiler does not support this.

 

What happens if you try stdint.h types (which is a more sensible choice anyway) ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

Thanks again for speedy reply.

 

I am working ATMEL studio for ARM. 

Also I tried to use uint64_t typedef data type which is used in most of ASF drivers as well.

 

I have also not got error for uint64_t variable.

 

But when load uint64_t variable with value more 32bit i.e. e.g. 0x1FFFFFFFF; this gives warning "use of C99 long long interger constant [-Wlong long] "

But even though i haven't got error, i got only warning, I am not getting the desired results.

 

Please try this on ARM - ATMEL studio and select CPU = ATSAML22N18A.

 

Thanks,

Warm Regards,

Nilesh

Nilesh

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

nileshb wrote:
t i.e. e.g. 0x1FFFFFFFF; this gives warning "use of C99 long long interger constant [-Wlong long] "
I hope you meant "0x1FFFFFFFFLL" and not just "0x1FFFFFFFF" or it's bound to warn you isn't it?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

I tried as suggested by you.

 

Please find attached screenshots.

 

Also I have one more question, I have configured stdio driver and I am using printf to print data on terminal utilities. Does it support uint64_t values to print?

 

Thanks,

Nilesh

Attachment(s): 

Nilesh

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One of your problems there is that the first "%ll" is supposed to be "%llu"

 

Seems to me that the C99/long long thing is just a warning anyway.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

Please find attached screenshots.

 

Thanks,

Nilesh

Attachment(s): 

Nilesh

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't do ARM (well not Atmel) but could it be that the runtime for printf() does not support the format?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

Thanks for the reply. I was nice talking to you.

 

Can you please forward this to ARM team, Because I can see the forum for ATMEL ARM but when it comes to posting messages i couldn't find it for ATMEL ARM.

 

Thanks,

Nilesh

Nilesh

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

nileshb wrote:
i couldn't find it for ATMEL ARM.
I have moved this entire thread to the Cortex M forum which covers that SAML22 (an M0 device I believe?). Hopefully an arm-gcc user can shed more light on this for you.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

1. I am working on ATMEL ARM-Cortex-M ATSAML22N18A CPU and using ASF stack. It is giving warning for unsigned long long int data types. i.e. "ISO C90 doesn't support unsigned long long".

2. by default -std=gnu99 is set in compiler settings.  I tried using C99 as well. But no success.

3.  I am working ATMEL studio 7.0 for ARM cortex-M0+.  Also I tried to use uint64_t typedef data type which is used in most of ASF drivers as well. I have also not got error for uint64_t variable. But when load uint64_t variable with value more 32bit i.e. e.g. 0x1FFFFFFFF; this gives warning "use of C99 long long interger constant [-Wlong long] "

But even though i haven't got error, i got only warning, I am not getting the desired results. Please try this on ARM - ATMEL studio and select CPU = ATSAML22N18A.

4.  I have configured stdio driver and I am using printf to print data on terminal utilities. Does it support uint64_t values to print?

Please find attached screenshots.

Please suggest to add support for unsigned long long int data type.

Thanks,

Warm Regards,

Nilesh.

Nilesh