FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [February 2010 Threads] G++ and C in FreeRTOS Posted by Bill Yang on February 17, 2010 Hi,
I have a question regarding using different tool chain in FreeRTOS demo. I have a demo called FreertosLwipExemplo1 that is FreeRTOS + lwIP + Keil + LM3S web server demo. I think the source code was created and compiled by G++. When I compiled it with Keil RVMDK C compiler, I got the compiling error as below.
xSemaphoreHandle ETHRxBinSemaphore [MAX_ETH_PORTS] ={ [0 ... (MAX_ETH_PORTS - 1)] = NULL }; ETHIsr.c(82): error: #29: expected an expression
Actually I am not familiar with C++ or G++, but I believe that initializing a semaphore handler using [0 ... ] = NULL is for C++/G++, but did not for the C syntax, so I just commented the these [0 .....().] and left the NULL there. The compile is passed now.
I wonder if any suggestion or ideal about my question.
Thanks, Bill
RE: G++ and C in FreeRTOS Posted by MEdwards on February 17, 2010 Don't think you asked a question.
RE: G++ and C in FreeRTOS Posted by Bill Yang on February 17, 2010 My question if this initialization sentence is a C++/G++ stype? xSemaphoreHandle ETHRxBinSemaphore [MAX_ETH_PORTS] ={ [0 ... (MAX_ETH_PORTS - 1)] = NULL };
If using below one to replace above one, is it OK? xSemaphoreHandle ETHRxBinSemaphore [MAX_ETH_PORTS] ={ NULL };
Thanks, Bill
RE: G++ and C in FreeRTOS Posted by MEdwards on February 17, 2010 You definitely cannot use C++ code in your C program, if that is what you are asking. Initialize it any way you like, this is just a C question and again not FreeRTOS related.
RE: G++ and C in FreeRTOS Posted by Richard Damon on February 18, 2010 edwards, while you can't (in general) use C++ syntax in a C program, FreeRTOS is compatible with C++ (I know, as I use it this way in a project, and Richard has placed the appropriately guarded extern "C" statements in the headers so it works). Note that if ETHRxBinSemaphore is a global, then the language definition (C and C++) defines that it will be zero/NULL initialized automatically.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|