Miranda prototypes
Jim Weirich, on the Ruby mailing list, wrote:
In ANSI C, a function without a prototype is automatically given a
"Miranda"[0] prototype that matches the arguments of its first use.
Usages after the first use will use the miranda prototype.
[0] Miranda Prototypes. So named for the US miranda rights read to
criminals upon arrest ... paraphrased in part "... if you do not have an
attorney, one will be appointed to you ...". Substitute "prototype"
for "attorney".
Weird. I don't recall reading about that in any of the
ANSI C Standards. (Maybe the years of being on the C++
Standards committee pushed that bit out of my brain, or
maybe this is one of the changes in C99?)
I hadn't heard the term "Miranda prototype" before, but my
first reaction was that it had to do with a different section
of the legal spiel. The section most commonly mentioned
says "You have the right to remain silent" ...
about which type(s) of argument(s) you expect.
In other words, a function without a prototype is given
a prototype which will accept any arguments.
9:25:35 AM