element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Achievement Levels
    • Benefits of Membership
    • Feedback and Support
    • Members Area
    • Personal Blogs
    • What's New on element14
  • Learn
    Learn
    • eBooks
    • Learning Center
    • Learning Groups
    • STEM Academy
    • Webinars, Training and Events
  • Technologies
    Technologies
    • 3D Printing
    • Experts & Guidance
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Arduino Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Project Groups
    • Raspberry Pi Projects
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Or choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Software Application Development What C programming version supports zynq7000(Xilinx SDK)
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Avnet Boards Forums requires membership for participation - click to join
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 3 replies
  • Subscribers 175 subscribers
  • Views 145 views
  • Users 0 members are here
Related

What C programming version supports zynq7000(Xilinx SDK)

Former Member
Former Member over 9 years ago

I would like to know what C version is the natural for zynq programming(Xilinx SDK).

I'm only sure it's not C99 because when I try
for (int i = 0; i<10 ; i++)
I get the error:
error: 'for' loop initial declarations are only allowed in C99 mode

I've been looking around but I haven't found nothing usefull, I'm interested in the C "manual" supported by zynq 7000 devices (Xilinx SDK)because is very annoying to see this error.

Also I prefer not to use the -std=c99 options because I don't know if it is 100% compatible.

Thanks,
Guillermo

  • Sign in to reply
  • Cancel
  • zedhed
    0 zedhed over 9 years ago

    Hi Guillermo,

    Xilinx SDK uses the gcc compiler in a default installation and for Zynq targets uses the Sourcery CodeBench Lite compiler.  I checked in my 2014.2 installation and the gcc version is reported as 4.8.1 so you would get the support of that version of compiler and you can access the GNU documentation online:

    https://gcc.gnu.org/onlinedocs/4.8.1/

    It appears as though gcc supports C89/C90 standards by default if you do not specify which language standard to be used during compile time:

    https://gcc.gnu.org/onlinedocs/gcc-4.8.1/gcc/Standards.html#Standards

    So your code:

    for (int i = 0; i < 10; i++) { ...

    is not valid in the C89/C90 standard.

    But if you were to move your integer declaration outside the loop, that would be valid.

    int i;
    for (i = 0; i < 10; i++) { ...

    Your original code is allowed in C99 and later standards of the C language.  According to the gcc documentation, if you want to use the C99 version of the C standard, then you should use the -std=c99 or -std=iso9899:1999 options.

    Regards,

    -Kevin

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 9 years ago in reply to zedhed

    hi Kevin,

    thanks for the replay, I supposed that after doing more research.

    But now, my question is:
    Is c99 100% supported using zynq 7000? (I have a zedboard)
    I will try doing c99, but if I found strange behavior it would be good to knw if it is my fault or compilers.

    Thanks,
    Guillermo

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • zedhed
    0 zedhed over 9 years ago

    Hi Guillermo,

    Well the compiler that comes with SDK comes from the GCC code base.  If you are experiencing issues with the compiler, you can refer back to the GCC documentation or source code.

    I am not sure what you mean by the question "Is c99 100% supported using zynq 7000?" since it is the compiler itself that supports the C99 standard and in turn generates machine code which targets the ARM processor on Zynq.

    Regards,

    -Kevin

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube