Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

Nios II Software Build Tools for Eclipse - c99 mode

Hi every one!

I'm using Quartus 11.0 sp1 and Nios II Software Build Tools for Eclipse with DE2-70 Altera board.

How can I configure "mingw nios ii gcc4" in eclipse to use the c99 mode? (I have other toolchains available in addition to MinGW NIOS II GCC4)

I searched the web for this topic and I found results for "Eclipse CDT". The solution is to modify the flags under:

Project Properties > C/C++ Build > Settings > GCC C Compiler > Miscellaneous
and add -std=c99

However I didn't find such configurations with the "Nios II Software Build Tools for Eclipse".

I apologize if the question is dumb. I am still a newbie.

I appreciate any help.

Thanks in advance.

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Why do you need to explicitly specify -std=c99?

    gcc tends to support most of c99 without it.

    Specifying -std=c99 also removes some of the gcc builtins - like alloca(), which can only really be implemeted by the compiler.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    using the software build tools eclipse gui

    Right Click On Project Folder in the Project Explorer

    Select Properties

    Nios II Application Properties

    User Flags: -std=c99

    With software build tools sometimes setting -std=c99 in the GUI doesn't seem to stick :mad:. I never figured out why :confused:. What I did to make it stick was to edit the projects MAKEFILE directly by setting the APP_FLAGS_USER_FLAGS to include -std=c99 .

    using the makefile (direct method)

    search for app_cflags_user_flags

    app_cflags_user_flags := -std=c99

    legacy nios ii tools

    Right Click On Project Folder in the Project Explorer (aka NIOS II C/C++ Projects tab)

    Select Properties

    Select The C/C++ Build item

    Tool Settings Tab

    NIOS II Compiler-->General Folder

    Compiler Flags: -std=c99
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    using the software build tools eclipse gui

    Right Click On Project Folder in the Project Explorer

    Select Properties

    Nios II Application Properties

    User Flags: -std=c99

    With software build tools sometimes setting -std=c99 in the GUI doesn't seem to stick :mad:. I never figured out why :confused:. What I did to make it stick was to edit the projects MAKEFILE directly by setting the APP_FLAGS_USER_FLAGS to include -std=c99 .

    using the makefile (direct method)

    search for app_cflags_user_flags

    app_cflags_user_flags := -std=c99

    --- Quote End ---

    Yes, setting -std=c99 in the GUI doesn't seem to stick in Q13.1

    http://www.altera.com/support/kdb/solutions/rd10132014_789.html