From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26715 invoked by alias); 2 May 2005 11:22:39 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 26151 invoked from network); 2 May 2005 11:22:10 -0000 Received: from unknown (HELO web60619.mail.yahoo.com) (209.73.178.187) by sourceware.org with SMTP; 2 May 2005 11:22:10 -0000 Received: (qmail 5028 invoked by uid 60001); 2 May 2005 11:22:10 -0000 Message-ID: <20050502112210.5026.qmail@web60619.mail.yahoo.com> Received: from [210.5.119.147] by web60619.mail.yahoo.com via HTTP; Mon, 02 May 2005 12:22:10 BST Date: Mon, 02 May 2005 11:22:00 -0000 From: Bencio Aristo Subject: Help Needed! To: gcc-help@gcc.gnu.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2005-05/txt/msg00008.txt.bz2 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