Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site utcsstat.UUCP Path: utzoo!utcsstat!geoff From: geoff@utcsstat.UUCP (Geoff Collyer) Newsgroups: net.unix-wizards Subject: Re: _print/_doprnt; curses on sys III Message-ID: <1977@utcsstat.UUCP> Date: Mon, 18-Jun-84 13:57:22 EDT Article-I.D.: utcsstat.1977 Posted: Mon Jun 18 13:57:22 1984 Date-Received: Mon, 18-Jun-84 16:27:18 EDT References: <148@gargoyle.UChicago.UUCP> <1973@utcsstat.UUCP>, <4558@utcsrgv.UUCP> Organization: U. of Toronto, Canada Lines: 16 Programs that rely on the internals of a given stdio implementation are certainly grossly non-portable, but more importantly they are *BROKEN*. By using _doprnt, you are assuming that there exists a function in every stdio implementation similar to _doprnt in Dennis Ritchie's implementation. If such a function exists, it may be static and thus inaccessible, but it may not even exist. Defending existing programs on the grounds that they seem to work doesn't stand up to a moment's reflection; plenty of buggy programs have appeared to work due to flukes: the v7 mv called strcat to append to an uninitialised auto char array. Such behaviour was clearly a bug and deserved to be fixed; mv was broken, not just unportable. Sometimes correct code (using sprintf) is a bit longer than incorrect code (using stdio internals). Redeclaration of putc is ``perilous'' (stdio(3S)). I fail to see why putc needs to be redefined.