Article View: gnu.gcc.bug
Article #6047Re: Why is this possible?
From: Xavier Sunyer. PFC
Date: Wed, 11 Dec 1996 00:00
Date: Wed, 11 Dec 1996 00:00
22 lines
1599 bytes
1599 bytes
Hello: I'm using gcc2.6.3 under SunOS4.1.4. About the implicit declarations warnings, two comments: - sprintf() and printf() prototypes are declared (ANSI) in stdio.h; therefore you should include this header instead of string.h. - it may be that this change do not eliminates the printf() warning; I've found that printf's prototype -among others- is only declared if the macro __USE_FIXED_PROTOTYPES__ is set. Then you can compile with -D__USE_FIXED_PROTOTYPES__ or add this line to your 'specs' file (you can locate it compiling with -v). About the bug reason, I'm agree with Martin Huber. To detect it, I suggest you to declare 'const char *str = "0.12345678' -I suppose you want const objects really be constant-. If you do this, during the compilation you'll have the warning "passing arg 1 of `sprintf' discards `const' from pointer target type". Victor Sune UPC sunye@eel.upc.es
Technical Details
Message-ID:
<58lv4j$4ob@diable.upc.es>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<32A687B4.430F@igd.fhg.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113d02,8c9ed5628eb65d44 X-Google-Attributes: gid113d02,public From: "Xavier Sunyer. PFC" <xsunye@diable.si.upc.es> Subject: Re: Why is this possible? Date: 1996/12/11 Message-ID: <58lv4j$4ob@diable.upc.es> X-Deja-AN: 203471743 sender: bug-gcc-request@prep.ai.mit.edu references: <32A687B4.430F@igd.fhg.de> content-type: text/plain; charset=us-ascii organization: Universitat Politecnica de Catalunya x-gateway: relay5.UU.NET from bug-gcc to gnu.gcc.bug; Wed, 11 Dec 1996 04:34:52 EST x-url: news:E1zIpq.73L@cadlab.it mime-version: 1.0 newsgroups: gnu.gcc.bug x-mailer: Mozilla 1.1N (X11; I; SunOS 4.1.4 sun4m)