Dear All,
I want to transfer a C code to C++ so I used "Embedded C++" option in CCS5. Everything works fine up to now. But One of the C file gives too many errors. Please see the following
1. Imagine a .C file can be compiled with no warning or error in CCS5 or CCS4 with its standart C compiler.
2. When I changed the Language options to "Embeded C++" the same file gives too many errors like below
a value of type "void *" cannot be assigned to an entity of type "tcp_pcb * xxx
argument of type "void *" is incompatible with parameter of type "err_t(*)(void *, tcp_pcb *, u16_t)"
3. I looked the errors in detail and see it is just the NULL pointer gives all of these errors. For example;
struct tcp_pcb *TelnetPCB;
TelnetPCB = NULL; // This gives a value of type "void *" cannot be assigned to an entity of type "tcp_pcb * xxx
tcp_recv(pcb, NULL); // This gives argument of type "void *" is incompatible with parameter of type "err_t(*)(void *, tcp_pcb *, u16_t)"
4. I think "embedded C++" does not allow to assign a NULL pointer to a typed pointer or a function pointer.
5. I thought that There is a choice on compiler options like "Do not restrict NULL pointer assignments" but there is nothing similar and I think I have to typecast all of the NULL assignments in my code and the code will have a very bad style. If I do the below everything is work fine but please think the function pointers I have to use with ethernet applications they are too long for typecasting :)
struct tcp_pcb *TelnetPCB;
TelnetPCB = (struct tcp_pcb *)NULL; // THIS IS OK
6. Is there any way to say the compiler do not bother NULL assignments ???
waiting for your urgent replies