Help Needed!

Bencio Aristo benciojr@yahoo.com
Mon May 2 11:22:00 GMT 2005


To whom it may concern,
 
I, together with other colleagues in a university in
the Philippines, are currently working on a study
regarding semantic checking of compilers. I would like
to ask some questions regarding the C compiler (gcc).
  
 
One semantic error we are looking at is the
inconsistent use of formats or types in printf and
scanf (the "%c", "%s", "%d", etc.)
   
an example of this semantic error is shown below:
   
void main (void){
 char word[5];
 printf("Please enter a word:");
 scanf("%s", &word);   
 printf("%c\n",word);  
}
 
Compilers should be able to determine whether the
format used in the scanf and printf for a variable are
the same. In this example, scanf used "%s" and in
printf, "%c" is used.This will cause error a runtime
error. This error also occurs in mixing up of other
types such as "%d", "%f" , and "%lf".
 
We are planning to do a study on this and how we can
implement it on an open source C compiler and see if
it would be feasible.
 

Which source file is responsible for the lexical and
syntax analyzing? (so that i may be able to add printf
and scanf as recognized symbols)

Thank you in advance.

________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html



More information about the Gcc-help mailing list