|
|||
|
This document shows its age. I remember complaining here some years ago
about this MSDOS questions but they are still there: 19.17c How can I suppress the dreaded MS-DOS ``Abort, Retry, Ignore?'' message? 19.23 How can I allocate arrays or structures bigger than 64K? 19.24 What does the error message ``DGROUP data allocation exceeds 64K'' mean, and what can I do about it? I thought that using large model meant that I could use more than 64K of data! 19.29 How do I get an accurate error status return from system on MS-DOS? 19.40b How do I... Use BIOS calls? Write ISR's? Create TSR's? 19.40d What are ``near'' and ``far'' pointers? MSDOS died some 20 years ago (more or less). CAN WE GET RID OF THAT? There is no word about windows/unix/Mac OS X and systems used TODAY... And there are things like: 7.17 I've got 8 meg of memory in my PC. Why can I only seem to malloc 640K or so? Theren't a single PC today that is shipped with less than 512K... most are shipped with 1-4GB, my machine has 12GB. And YES: MSDOS is dead. Other answers are just wrong: 11.8: I don't understand why I can't use const values in initializers and array dimensions, as in const int n = 5; int a[n]; The answer given is: The const qualifier really means ``read-only''; an object so qualified is a run-time object which cannot (normally) be assigned to. The value of a const-qualified object is therefore not a constant expression in the full sense of the term, and cannot be used for array dimensions, case labels, and the like. (C is unlike C++ in this regard.) When you need a true compile-time constant, use a preprocessor #define (or perhaps an enum). This is plain wrong. You CAN do this within a function in standard C. That should be mentioned there. ANd NOT only with const but with any variable of integer type. Another is: 2.6: I came across some code that declared a structure like this: struct name { int namelen; char namestr[1]; }; and then did some tricky allocation to make the namestr array act like it had several elements, with the number recorded by namelen. How does this work? Is it legal or portable? The answer starts with: It's not clear if it's legal or portable, but it is rather popular. And after a page of ramblings comes to: C99 introduces the concept of a flexible array member, which allows the size of an array to be omitted if it is the last member in a structure, thus providing a well-defined solution. That should be at the beginning, and the whole answer must be changed to reflect the fact that standard C accepts this! jacob |
|
|
||||
|
||||
|
|
|
|||
|
On 2010-02-06, jacob navia <jacob@jacob.remcomp.fr> wrote:
> MSDOS died some 20 years ago (more or less). > > CAN WE GET RID OF THAT? The most recent edition of Schildt's "C: The Complete Reference" still has near and far pointers. And, whether we like it or not, there's still code out there that has those references in it, and someone might need to port it. > This is plain wrong. You CAN do this within a function in standard C. > That should be mentioned there. ANd NOT only with const but with any > variable of integer type. It's not accurate for C99 or GNU C. The problem is that the question used "array size" as an example of something which implicitly needed an "integer constant", but of course, it's not anymore. > That should be at the beginning, and the whole answer must be changed > to reflect the fact that standard C accepts this! "must" seems a little strong. I agree that it would be great if Steve updated the FAQ. But, since I'm not paying him to do it, I don't feel like I'm in a great position to impose conditions or requirements. -s -- Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam@seebs.net http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated! |
|
|||
|
In article <slrnhmro53.f59.usenet-nospam@guild.seebs.net>,
Seebs <usenet-nospam@seebs.net> wrote: |On 2010-02-06, jacob navia <jacob@jacob.remcomp.fr> wrote: |> MSDOS died some 20 years ago (more or less). Hmm... I had to get PeeCee with DOS to play DOOM (now widely ported, but the DOS version came out first, and the other ports were missing features for a long time). That was less than 17 years ago. And not exactly an obscure application running on legacy hardware either. Of course that machine did come preinstalled with a "win" line in its autoexec.bat which in hindsight is recognizable as the beginning of the end of DOS. |> |> CAN WE GET RID OF THAT? | |The most recent edition of Schildt's "C: The Complete Reference" still |has near and far pointers. And, whether we like it or not, there's still |code out there that has those references in it, and someone might need |to port it. But the F in FAQ stands for something, and it's not "all questions ever". Killing off the ones that have become infrequent would make the list shorter, and a shorter list will be read by more people. | |> This is plain wrong. You CAN do this within a function in standard C. |> That should be mentioned there. ANd NOT only with const but with any |> variable of integer type. | |It's not accurate for C99 or GNU C. The problem is that the question used |"array size" as an example of something which implicitly needed an "integer |constant", but of course, it's not anymore. It still works if you assume it's outside of a function. Inside a function, change it to a case label in a switch to make the same point. -- Alan Curry |
|
|||
|
jacob navia <jacob@jacob.remcomp.fr> writes:
> This document shows its age. I remember complaining here some years ago > about this MSDOS questions but they are still there: > > 19.17c How can I suppress the dreaded MS-DOS ``Abort, Retry, Ignore?'' > message? [...] > MSDOS died some 20 years ago (more or less). > > CAN WE GET RID OF THAT? Is MSDOS really completely dead? I know it's not used much anymore, and I agree that it probably doesn't deserve as much mention as it gets in the FAQ, but I think it's still used in some niche applications. > There is no word about windows/unix/Mac OS X and systems used TODAY... > > And there are things like: > > 7.17 I've got 8 meg of memory in my PC. Why can I only seem to malloc > 640K or so? > > Theren't a single PC today that is shipped with less than 512K... You mean 512M, don't you? > most are shipped with 1-4GB, my machine has 12GB. And YES: MSDOS is > dead. Yes, the numbers are dated, but the principle is unchanged. The question and answer could both be improved by making them more generic. > Other answers are just wrong: > > > 11.8: I don't understand why I can't use const values in initializers > and array dimensions, as in > > const int n = 5; > int a[n]; > > The answer given is: > > The const qualifier really means ``read-only''; an object so qualified > is a run-time object which cannot (normally) be assigned to. The value > of a const-qualified object is therefore not a constant expression in > the full sense of the term, and cannot be used for array dimensions, > case labels, and the like. (C is unlike C++ in this regard.) When you > need a true compile-time constant, use a preprocessor #define (or > perhaps an enum). > > > This is plain wrong. You CAN do this within a function in standard C. > That should be mentioned there. ANd NOT only with const but with any > variable of integer type. Yes, in C99, which not all compilers fully support. (Yes, jacob, we know ...) I agree that that answer should be updated. Note, however, that n is *still* not a constant expression. C99 allows it to be used as an array dimension, but it still can't be used in case labels and a few other contexts. And depending on the cleverness of the compiler, there might be a difference between const int n = 5; int a[n]; /* This is a VLA */ and enum { n = 5 }; int a[n]; /* This is not a VLA */ Even if C99 were universally available, I'd still tend to prefer the latter, just to avoid runnng into any problems with the differences between VLAs and non-VLAs. > Another is: > 2.6: I came across some code that declared a structure like this: > > struct name { > int namelen; > char namestr[1]; > }; > > and then did some tricky allocation to make the namestr array act like > it had several elements, with the number recorded by namelen. How does > this work? Is it legal or portable? > > The answer starts with: > > It's not clear if it's legal or portable, but it is rather popular. Which is still true. There's still plenty of code that uses the struct hack, even though it's not needed in C99. The question begins, "I came across some code ..."; this is something that programmers are still likely to run into. (If nothing else, that answer would be improved by mentioning the phrase "struct hack".) > And after a page of ramblings comes to: > C99 introduces the concept of a flexible array member, which allows > the size of an array to be omitted if it is the last member in a > structure, thus providing a well-defined solution. > > That should be at the beginning, and the whole answer must be changed > to reflect the fact that standard C accepts this! I agree that the FAQ needs some updating. It was last updated in 2005, and that wasn't a complete update. But keep in mind that it's basically a one-man volunteer effort. I don't pretend to speak for Steve Summit, but perhaps he'd be interested in an project where we provide updated answers for his approval. We've always been free to provide input by e-mail, but that tends to be rather haphazard. -- Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst> Nokia "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister" |
|
|||
|
Keith Thompson wrote:
> jacob navia <jacob@jacob.remcomp.fr> writes: >> This document shows its age. I remember complaining here some years ago >> about this MSDOS questions but they are still there: >> >> 19.17c How can I suppress the dreaded MS-DOS ``Abort, Retry, Ignore?'' >> message? > [...] >> MSDOS died some 20 years ago (more or less). >> >> CAN WE GET RID OF THAT? > > Is MSDOS really completely dead? I am personally aware of several extant MS-DOS installations, on several separate sites. (In fact, I have one right here, about fifteen feet away.) By "MS-DOS installations", of course, I am excluding mere DOS-boxes and referring to the genuine article. Although MS-DOS is certainly on its way out, it is not yet completely dead. There are some good reasons for this, and some bad reasons too. One of the bad reasons is that some people are unwilling to migrate to newer systems because to do so would be to change a working system. Whilst one can have a certain amount of sympathy for this view, it is becoming more and more difficult to find support vendors for MS-DOS systems, and that means that the "working system" is increasingly likely to stop working. Better to grasp the bullet and migrate to something a little more current. One of the good reasons is that there are still some people who are prepared to support those who still use MS-DOS; and to do so, one needs at least one or two MS-DOS systems around the place, for testing purposes. <snip> >> Theren't a single PC today that is shipped with less than 512K... > > You mean 512M, don't you? He probably does, yes. All except one of the (many) computers in my home have less than 512MB memory, but none of the desktop machines have less than 512KB. Some people replace their machine every few months. To such people, an FAQ that dealt with ancient dinosaurs with a mere 1GB of memory is antiquated and needs replacing. Others either choose to, or have to, make their machines last many years. To such people, an FAQ that dealt only with the latest systems and hardware would be pointlessly faddish. <snip> -- Richard Heathfield <http://www.cpax.org.uk> Email: -http://www. +rjh@ "Usenet is a strange place" - dmr 29 July 1999 Sig line vacant - apply within |
|
|||
|
On 2/6/2010 4:10 PM, jacob navia wrote:
> This document shows its age. I remember complaining here [...] Why complain here? Why not complain to Steve Summit, the author of the FAQ and the holder of its copyright? His contact information is easily found in the -- wait for it -- FAQ ... -- Eric Sosman esosman@ieee-dot-org.invalid |
|
|||
|
On 06 Feb 2010 15:10, jacob navia wrote:
> MSDOS died some 20 years ago (more or less). No, MS DOS stopped shipping less than 10 years ago; it was still underneath the hood of MS Windows 3.x, 95, 98, and ME. > CAN WE GET RID OF THAT? Not until MS DOS--and every bit of source code that _assumes_ it is running on MS DOS even if it's actually under emulation--is completely eradicated, and I suspect that'll be another few decades. Every now and then, I find a useful piece of software for MS DOS that needs to be ported to something modern; understanding "near" and "far" pointers (and some other MS DOS oddities) is still useful. Even for those of us who were there, a refresher is still handy. OTOH, given this group's topicality Nazis, one could easily argue that any references to _any_ particular OS should be stricken from the FAQ. > There is no word about windows/unix/Mac OS X and systems used TODAY... Indeed, and that could use some work, along with many other ares. If you want it improved, I'm sure the maintainer would appreciate suggestions. > And there are things like: > > 7.17 I've got 8 meg of memory in my PC. Why can I only seem to malloc > 640K or so? > > Theren't a single PC today that is shipped with less than 512K... > most are shipped with 1-4GB, my machine has 12GB. And YES: MSDOS is > dead. True, though there are plenty of folks working on embedded systems that have even less memory than that; they're just not PCs. > Other answers are just wrong: > > 11.8: I don't understand why I can't use const values in initializers > and array dimensions, as in > > const int n = 5; > int a[n]; > > The answer given is: > > The const qualifier really means ``read-only''; an object so qualified > is a run-time object which cannot (normally) be assigned to. The value > of a const-qualified object is therefore not a constant expression in > the full sense of the term, and cannot be used for array dimensions, > case labels, and the like. (C is unlike C++ in this regard.) When you > need a true compile-time constant, use a preprocessor #define (or > perhaps an enum). > > > This is plain wrong. You CAN do this within a function in standard C. > That should be mentioned there. ANd NOT only with const but with any > variable of integer type. True, it's been a poor example since C99 added VLAs. Better would be a switch/case statement, where a "const int" still can't be used. > Another is: > 2.6: I came across some code that declared a structure like this: > > struct name { > int namelen; > char namestr[1]; > }; > > and then did some tricky allocation to make the namestr array act like > it had several elements, with the number recorded by namelen. How does > this work? Is it legal or portable? > > The answer starts with: > > It's not clear if it's legal or portable, but it is rather popular. > > And after a page of ramblings comes to: > C99 introduces the concept of a flexible array member, which allows the > size of an array to be omitted if it is the last member in a structure, > thus providing a well-defined solution. > > That should be at the beginning, and the whole answer must be changed > to reflect the fact that standard C accepts this! Indeed. In general, as with the comment directly above, it appears that the FAQ has not been updated to reflect the changes from C99 or, at minimum, documented to say the answers only refer to C89. S -- Stephen Sprunk "God does not play dice." --Albert Einstein CCIE #3723 "God is an inveterate gambler, and He throws the K5SSS dice at every possible opportunity." --Stephen Hawking |
|
|||
|
On 2010-02-06, Seebs <usenet-nospam@seebs.net> wrote:
> On 2010-02-06, jacob navia <jacob@jacob.remcomp.fr> wrote: >> MSDOS died some 20 years ago (more or less). >> >> CAN WE GET RID OF THAT? > > The most recent edition of Schildt's "C: The Complete Reference" still > has near and far pointers. And, whether we like it or not, there's still > code out there that has those references in it, and someone might need > to port it. The F in FAQ stands for something, though. |
|
|||
|
Richard Heathfield a écrit :
>> jacob navia <jacob@jacob.remcomp.fr> writes: >>> This document shows its age. I remember complaining here some years ago >>> about this MSDOS questions but they are still there: >>> >>> 19.17c How can I suppress the dreaded MS-DOS ``Abort, Retry, Ignore?'' >>> message? >> [...] >>> MSDOS died some 20 years ago (more or less). >>> >>> CAN WE GET RID OF THAT? >> > > I am personally aware of several extant MS-DOS installations, on several > separate sites. (In fact, I have one right here, about fifteen feet > away.) I would never doubt that. It is just near your 10 year old version of gcc that you refuse to upgrade, and near a version of the C89 standard that you also refuse to upgrade. And behind that MSDOS system is a song of Jethro Tull: "Living in the past". Ahhh those were the times my friend. They will never come again. |
|
|||
|
Stephen Sprunk a écrit :
> On 06 Feb 2010 15:10, jacob navia wrote: >> MSDOS died some 20 years ago (more or less). > > No, MS DOS stopped shipping less than 10 years ago; it was still > underneath the hood of MS Windows 3.x, 95, 98, and ME. > The Win32 API of 95 is still there. So what? You would tell me that MSDOS is still shipping today or what? We are speaking of the FAQ of 2010, not the FAQ of 2000 or 1995. The "F" means FREQUENT and I do not see much people around developing ìn MSDOS. I could (maybe) understand if there were questions concerning Unix development, or windows questions but MSDOS? |
|
|||
|
In article <hklkom$3h1$1@speranza.aioe.org>,
jacob navia <jacob@jspamsink.org> wrote: >Stephen Sprunk a écrit : >> On 06 Feb 2010 15:10, jacob navia wrote: >>> MSDOS died some 20 years ago (more or less). >> >> No, MS DOS stopped shipping less than 10 years ago; it was still >> underneath the hood of MS Windows 3.x, 95, 98, and ME. >> > >The Win32 API of 95 is still there. So what? You would tell me that >MSDOS is still shipping today or what? > >We are speaking of the FAQ of 2010, not the FAQ of 2000 or 1995. The >"F" means FREQUENT and I do not see much people around developing >ìn MSDOS. I could (maybe) understand if there were questions concerning >Unix development, or windows questions but MSDOS? Just to argue the other side of this - let's remember that this is C we're talking about here. An old-fashioned language that served us well, but is, itself, basically obsolete. This is not to say that it isn't still used or anything like that - but the fact is that very little new development, on current/new OSes and platforms, is done in C. Even C++ is considered "old" by most people these days. Further, let's stipulate that both DOS and Unix are also considered "old". Again, this doesn't mean that they aren't both in use and even developed for, in various niche application domains. So, what this all leads to is that it makes sense for the C FAQ to contain a lot of content about DOS and Unix, since a lot of what makes C what it is (warts and all) is tied to those OSes. |
|
|||
|
jacob navia wrote:
> This document shows its age. I remember complaining here some years ago > about this MSDOS questions but they are still there: <snip DOS questions> > MSDOS died some 20 years ago (more or less). Nope. MS-DOS is still around, albeit as a lurker beneath WIndows. Yes, huge numbers of people still use Windows 98/ME/2000/XP, all of which provided DOS mode/prompt. I don't know about Vista and 7, but while Vista died in infancy, 7 is yet to be widely adopted. Reluctance to change a working system and learn new interfaces, and cost of migrating are some important factors for why these "legacy" systems are still widely used. Much of the same reasoning applies to why Turbo C is still being widely used for teaching introductory C. But I haven't seen a single "pure" MS-DOS installation since atleast a decade. But the pertinent question is not if MS-DOS is dead or not, but how much C programming is still being done under DOS or DOS mode. As I said above, many introductory C classes still use the Turbo C/DOS prompt combine due to reasons given above. Some popularly used C "textbooks" still make heavy references to, and contain instructions for, DOS, making the new student think he must start with Turbo C/DOS. Other than this I guess that DOS programming is still being actively done only by DOS enthusiasts (of which there're still very many), and perhaps in certain embedded areas. So I guess it'd be cleaner if the DOS FAQs were moved into a separate "DOS" section of the FAQ. Though I wouldn't like to see them removed altogether, having them all collected under a single link would make the rest of FAQ cleaner and more up-to-date seeming for the rest of us. <snip> |
|
|||
|
jacob navia <jacob@spamsink.net> wrote:
> The Win32 API of 95 is still there. So what? You would tell me that > MSDOS is still shipping today or what? Not MSDOS, but you can get freedos. (I run dos applications in dosemu here). Mark. -- Mark Hobley Linux User: #370818 http://markhobley.yi.org/ |
|
|||
|
jacob navia wrote:
> Richard Heathfield a écrit : >>> jacob navia <jacob@jacob.remcomp.fr> writes: >>>> This document shows its age. I remember complaining here some years ago >>>> about this MSDOS questions but they are still there: >>>> >>>> 19.17c How can I suppress the dreaded MS-DOS ``Abort, Retry, Ignore?'' >>>> message? >>> [...] >>>> MSDOS died some 20 years ago (more or less). >>>> >>>> CAN WE GET RID OF THAT? >>> >> >> I am personally aware of several extant MS-DOS installations, on >> several separate sites. (In fact, I have one right here, about fifteen >> feet away.) > > I would never doubt that. It is just near your 10 year old version of > gcc that you refuse to upgrade, and near a version of the C89 standard > that you also refuse to upgrade. Actually, IIRC my gcc version is only 8 years old and is installed on a Linux machine, not my DOS machine. I have a copy of the C99 Standard, of course (also on a Linux machine, and I have a number of drafts of revisions to the Standard published since 1999). And neither of those facts has anything whatsoever to do with my MS-DOS installation, which I actually keep around precisely because some of my users do have MS-DOS installations and I like to be able to test code using their OS. Is that okay with you, or should I tell them Jacob Navia says to get lost? > And behind that MSDOS system is a song of Jethro Tull: > > "Living in the past". Good song. "Now there's revolution, but they don't know what they're fighting", which we might render as "changing for the sake of change", which is normally a very silly idea. > Ahhh those were the times my friend. They will never come again. It is (mostly) because those times haven't yet gone that I keep this antique heap of junk lying around instead of taking it down to the tip. -- Richard Heathfield <http://www.cpax.org.uk> Email: -http://www. +rjh@ "Usenet is a strange place" - dmr 29 July 1999 Sig line vacant - apply within |
|
|||
|
On 2010-02-07, jacob navia <jacob@spamsink.net> wrote:
> Stephen Sprunk a écrit : >> On 06 Feb 2010 15:10, jacob navia wrote: >>> MSDOS died some 20 years ago (more or less). >> >> No, MS DOS stopped shipping less than 10 years ago; it was still >> underneath the hood of MS Windows 3.x, 95, 98, and ME. >> > > The Win32 API of 95 is still there. So what? You would tell me that > MSDOS is still shipping today or what? > > We are speaking of the FAQ of 2010, not the FAQ of 2000 or 1995. The > "F" means FREQUENT and I do not see much people around developing > ìn MSDOS. I could (maybe) understand if there were questions concerning > Unix development, or windows questions but MSDOS? > I second this. MS-DOS has terribly limited networking support, almost no support for modern filesystems, primitive threading and IIRC, no memory protection. (Actually, the DOS functions were so slow that you /had/ to use MMIO directly to draw graphics at any decent speed.) In any case, I do not believe that the memory limitations discussed in the FAQ are at all frequently met. In fact, I doubt that most C programmers encounter /any/ memory limits on desktop PC's anymore. Certainly not when they're learning and need a FAQ. |
|
|
|
|
![]() |
| Popular Tags in the Forum |
| faq |
| Thread Tools | |
| Display Modes | |
|
|