From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9873 invoked by alias); 2 May 2005 15:57:36 -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 9782 invoked from network); 2 May 2005 15:57:23 -0000 Received: from unknown (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org with SMTP; 2 May 2005 15:57:23 -0000 Received: from root by ciao.gmane.org with local (Exim 4.43) id 1DSdBc-00023F-5f for gcc-help@gcc.gnu.org; Mon, 02 May 2005 17:50:20 +0200 Received: from host-26-133-230-24.midco.net ([24.230.133.26]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 May 2005 17:50:20 +0200 Received: from jeffholle by host-26-133-230-24.midco.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 May 2005 17:50:20 +0200 To: gcc-help@gcc.gnu.org From: Jeffrey Holle Subject: Re: Help Needed! Date: Mon, 02 May 2005 15:57:00 -0000 Message-ID: References: <20050502112210.5026.qmail@web60619.mail.yahoo.com> Reply-To: jeffholle@beu.midco.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040115 In-Reply-To: <20050502112210.5026.qmail@web60619.mail.yahoo.com> X-SW-Source: 2005-05/txt/msg00010.txt.bz2 I believe that this is already implemented in gcc, though I've never tried it. See: http://www.unixwiz.net/techtips/gnu-c-attributes.html Bencio Aristo wrote: > 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 >