no error in strange sintaxis return()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, while I was trying to return local variable as (const char *)
return "value_of_var_a";

I put a strange return, something like this:

return ("%s",a);

> unsigned char *
> laca (const unsigned char *page, const unsigned int id)
> {
>   unsigned char a[SIZE_MARCA];
>   strcpy (a, "Hello");
>   if (id == 1)
>     {
>       return "page1";
>     }
>   else
>     {
> /*printf("%u",("%s",a));*/ /*strange sintaxis*/
>       return ("%s",a); /*strange sintaxis*/
>     };
> }

No warning messages are returned by compiler! Why?
And if I uncomment printf(...), program return correct stream. Commented anything is returned.

Compiler should caught the last argument  of lists only (a).



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux