Re: Discussion about why GNU/Linux system upgrades cause old programs to break
Richard Stallman <[email protected]>
| Newsgroups | gmane.emacs.devel |
|---|---|
| Message-ID | <[email protected]> |
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> > So I wonder, why was the result failure rather than such warnings.
> > Eli, would you like to investigate why?
> >
> > ~$ gcc -x c -std=gnu89 - <<<'main(argc, argv) int argc; char **argv; {
> > char *x = reallocarray(strdup (argv[0]), 100, 1); printf ("%d %s\n", argc, x);
> > exit (0); }'
> >
> > What is the problem with this one? Is it that the value of strdup is 64 bits
> > and reallocarray's first argument is taken as int?
> Yes, the implicit declaration that K&R C specifies for undeclared
> functions can easily mismatch what the actual definition is, and indeed
> it is incorrect for reallocarray, so it breaks.
Similar code (in Emacs 23 ?) worked in the past -- this problem did not
occur, it seems. Why did that code work then?
--
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)