Skip to main content
JulienD
Associate III
June 9, 2015
Question

Compilation error with c++11 dialect

  • June 9, 2015
  • 5 replies
  • 841 views
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
    This topic has been closed for replies.

    5 replies

    waclawek.jan
    Super User
    June 9, 2015
    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
    June 9, 2015
    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.

    waclawek.jan
    Super User
    June 9, 2015
    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 III
    June 10, 2015
    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
    JulienDAuthor
    Associate III
    June 15, 2015
    Posted on June 15, 2015 at 11:02

    Ok, thanks to all.

    Julien