public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: A TINY BUG
@ 1997-10-06  9:16 David C. Hoos, Sr.
  1997-10-06 17:13 ` $Bill Luebkert
  0 siblings, 1 reply; 12+ messages in thread
From: David C. Hoos, Sr. @ 1997-10-06  9:16 UTC (permalink / raw)
  To: tage.westlund, gnu-win32

This is the kind of thing which compilers do not catch, because the problem
is specific to
the printf function which is a library unit, and not part of the language.
In other words, as long as the first argument to printf is of type char *,
then the function profile is matched.  If the string to which that first
parameter points is not a valid printf format string matching the other
pritf parameters, the compiler doesn't know it.  Furthermore, the string to
which the first parameter of printf points can be (and often is) modified at
run time, to fit the format to the occasion.

If you want to catch this sort of problem at build time, you need to use
"lint", and it is only
able to catch certain things because of the possibility of run-time
modification.

Better yet, write your program in ada95, using the free gnat-3.10p1 compiler
from
ftp://ftp.cs.nyu.edu/pub/gnat/winnt

David C. Hoos, Sr.,
david.c.hoos.sr@ada95.com

-----Original Message-----
From: Tage Westlund <tage.westlund@stockholm.mail.telia.com>
To: gnu-win32@cygnus.com <gnu-win32@cygnus.com>
Date: Monday, October 06, 1997 4:38 AM
Subject: A TINY BUG


>To gnu designers!
>I have found that the following bad code gives "exception" at run
>time instead of error message at compilation time (b18 Win95):
>
>#include <stdio.h>
>main(){
> printf("%s\n",sizeof(long));
>}
>Tage
>
>-
>For help on using this list (especially unsubscribing), send a message to
>"gnu-win32-request@cygnus.com" with one line of text: "help".
>

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: A TINY BUG
@ 1997-10-07  0:12 Pascal OBRY
  0 siblings, 0 replies; 12+ messages in thread
From: Pascal OBRY @ 1997-10-07  0:12 UTC (permalink / raw)
  To: jazz, tage.westlund; +Cc: gnu-win32

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1302 bytes --]

>> I have found that the following bad code gives "exception" at run
>> time instead of error message at compilation time (b18 Win95):
>>
>> #include <stdio.h>
>> main(){
>>         printf("%s\n",sizeof(long));
>> }

>Summary: learn more about the language before whining about compiler
>errors. This is a programmer bug, not a compiler bug.

What about : this is a language bug :-)

Pascal.

--|------------------------------------------------------------
--| Pascal Obry                               Team-Ada Member |
--|                                                           |
--| EDF-DER-IPN-SID- G A L A X I E                            |
--|                         web   : http://cln49ae            |
--| Bureau N-023            e-mail: pascal.obry@der.edfgdf.fr |
--| 1 Av Général de Gaulle  voice : +33-1-47.65.50.91         |
--| 92141 Clamart CEDEX     fax   : +33-1-47.65.50.07         |
--| FRANCE                                                    |
--|------------------------------------------------------------
--|
--|   http://ourworld.compuserve.com/homepages/pascal_obry
--|
--|   "The best way to travel is by means of imagination"
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 12+ messages in thread
* A TINY BUG
@ 1997-10-06  1:19 Tage Westlund
  1997-10-06  9:53 ` Jason Zions
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Tage Westlund @ 1997-10-06  1:19 UTC (permalink / raw)
  To: gnu-win32

To gnu designers!
I have found that the following bad code gives "exception" at run
time instead of error message at compilation time (b18 Win95):

#include <stdio.h>
main(){
	printf("%s\n",sizeof(long));
}
Tage

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~1997-10-07  6:18 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-10-06  9:16 A TINY BUG David C. Hoos, Sr.
1997-10-06 17:13 ` $Bill Luebkert
  -- strict thread matches above, loose matches on Subject: below --
1997-10-07  0:12 Pascal OBRY
1997-10-06  1:19 Tage Westlund
1997-10-06  9:53 ` Jason Zions
1997-10-06 12:27   ` Steve Dum
1997-10-06 12:40   ` Matthew Moskewicz
1997-10-06 14:27   ` Marty Leisner
1997-10-06 17:13   ` Steve Tynor
1997-10-06 18:01   ` Chris Faylor
1997-10-06 15:47 ` Charles Curley
1997-10-07  6:18 ` Jon Thackray

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).