cancel
Showing results for 
Search instead for 
Did you mean: 

Compilation error with c++11 dialect

JulienD
Senior
Posted on June 09, 2015 at 15:44

Hi,

I would like to use C++ 11 dialect with ac6 tools suite.

But I get a compilation error that I'm not able to handle.

Code :

register char* stack_ptr asm(''sp'');

Error :

error: expected '=', ',', ';', 'asm' or '__attribute__' before 'asm'

What should I do ?

regards

Julien
5 REPLIES 5
Posted on June 09, 2015 at 16:06

Contact your toolchain vendor, i.e. ac6.

As they ''sold you'' nothing more than Eclipse+gcc, you might be better off following https://gcc.gnu.org/bugs/ .

JW

[EDIT] Shouldn't that be __asm()?
qwer.asdf
Senior
Posted on June 09, 2015 at 16:34

''asm'' is not standard C++, it's GNU extension to the language, so you must use the

-std=gnu++11 option instead of -std=c++11.

Posted on June 09, 2015 at 17:10

Or use __asm__() (as I said above I use __asm() which works but may be dependent on some of the mentioned switches too).

https://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html#Alternate-Keywords

JW
carl2399
Associate II
Posted on June 10, 2015 at 05:00

Have you tried looking in core_cmFunc.h?

Specifically:

/** \brief Get Process Stack Pointer
This function returns the current value of the Process Stack Pointer (PSP).

eturn PSP Register value
*/
static

__INLINE uint32_t __get_PSP(

void

)
{
register uint32_t __regProcessStackPointer __ASM(

''psp''

);
return

(__regProcessStackPointer);
}

It may be that the function has already been supplied. Regards, Carl.
JulienD
Senior
Posted on June 15, 2015 at 11:02

Ok, thanks to all.

Julien