F
Frank
In Dread Ink, the Grave Hand of Stephen Sprunk Did Inscribe:
That's not a bug; it's a feature. When I want to say
declaration/definition, I get it wrong more than fifty percent of the time.
My sense was that there was only one definition, and that two different
defintions is not standard C. I'll know more about this when Plauger's
book shows up.
How about when you throw restrict and format in there?
No one local to me seems to think I'm an idiot.
--
Frank
During the Reagan Administration, Bob Dole was present at a ceremony that
included each living ex-president. Looking at a tableau of Ford, Carter and
Nixon, Dole said, 'There they are: Hear No Evil, See No Evil and Evil.'
~~ Al Franken,
[ My apologies for the flood of delayed responses; my old news server
was silently eating all my posts for the last week or so.]
I don't know what happens here during compilation or execution.
I meant with stdio.h included. It draws errors from my
implementation:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int printf(const char *, ...); /* line 5 */ [snip]
int printf(char * r, ...) /* line 23 */ [snip]
Wedit output window build: Sat Oct 03 11:56:39 2009
Error c:\lcc\source\nick2.c: 23 redefinition of 'printf'
Error c:\lcc\source\nick2.c: 5 Previous definition of 'printf' here
Your compiler is buggy; line 5 does not define printf() -- it merely
declares it.
That's not a bug; it's a feature. When I want to say
declaration/definition, I get it wrong more than fifty percent of the time.
My sense was that there was only one definition, and that two different
defintions is not standard C. I'll know more about this when Plauger's
book shows up.
However, what I suspect your compiler meant to complain about is that
the argument types of those two lines do not agree; one has a (const
char *) and the other has a (char *).
How about when you throw restrict and format in there?
#include'ing <stdio.h> and then providing your own declaration of
printf() is a Bad Idea(tm). The point of #include'ing headers is so
that you don't _need_ to write those declarations -- which you may get
wrong.
#include'ing <stdio.h> and then providing your own definition of
printf() is also a Bad Idea(tm). If you don't want to use the standard
library's printf() and will provide your own function with that name, do
not #include <stdio.h> -- and expect anyone else who sees your code to
be confused and/or think you're an idiot.
No one local to me seems to think I'm an idiot.
--
Frank
During the Reagan Administration, Bob Dole was present at a ceremony that
included each living ex-president. Looking at a tableau of Ford, Carter and
Nixon, Dole said, 'There they are: Hear No Evil, See No Evil and Evil.'
~~ Al Franken,