Re: query related to semantic behaviourial comparision in C thru gcc

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

 



Hi Silver,

void printSymtab(void)
{
  Symtab *tptr;
  Symtab t;


puts("**************\n\t\tSymTable**************"); puts(" Name PIB PIH BlkNo ");

  printf("%u", t);      	<-------------ALLOWED
// t gets passed in by address.  Even though you are using that address
// as a "%u" ... which isn't going to be pretty.

  if (t) ;			<-------------NOT ALLOWED (line 84)
// Assuming Symtab is a struct, you are using a struct as an expression.

  if (tptr);			<-------------This is OKAY
// Testing a pointer as being non-null is okay.  Style-wars aside.

  if (*tptr);			<---------NOT ALLOWED/possibly it is error
								(line 88)	
// Assuming Symtab is a struct, you are using a struct as an expression.

  return;
}

HTH,
--Eljay


[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