delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/10/06/17:46:48

From: tynor AT atlanta DOT twr DOT com (Steve Tynor)
Subject: Re: A TINY BUG
6 Oct 1997 17:46:48 -0700 :
Message-ID: <9710062304.AA08705.cygnus.gnu-win32@atlanta.twr.com>
References: <34391696 DOT 27758E19 AT softway DOT com>
Mime-Version: 1.0
To: Jason Zions <jazz AT softway DOT com>
Cc: tage DOT westlund AT stockholm DOT mail DOT telia DOT com, gnu-win32 AT cygnus DOT com

Jason Zions wrote:

| > #include <stdio.h>
| > main(){
| >         printf("%s\n",sizeof(long));
.....
| No compiler will detect this error at compile-time. The prototype for
.....
| printf is (char *, ...); that is, no specific type information for
| anything except the first parameter. A compiler would have to read the
| first parameter to figure out the expected types for the remaining args,
.....
| Summary: learn more about the language before whining about compiler
| errors. This is a programmer bug, not a compiler bug.

Before you flame, I suggest you read the gcc info page -- the great and
all powerful gcc _will_ detect this error -- at least is does on my
version of 2.7.2.1 on sparc-solaris.

Try using gcc -Wall (or -Wformat for just printf warnings).

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
In theory, there is no difference between theory and practice. 
But, in practice, there is.

Steve Tynor		Email:   Steve DOT Tynor AT atlanta DOT twr DOT com
Tower Technology 	WWW:     http://www.twr.com/
Retooling the Software Industry for the 21st Century (sm)
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019