This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
no error in strange sintaxis return()
- From: "Fco. J" <rootag at terra dot es>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 16 Sep 2005 17:03:02 +0200
- Subject: no error in strange sintaxis return()
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).