www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/03/22/21:48:28

Message-Id: <3.0.1.32.20010323104639.0071c1d4@wingate>
X-Sender: n_abing#ns DOT roxas-online DOT net DOT ph AT wingate
X-Mailer: Windows Eudora Pro Version 3.0.1 (32)
Date: Fri, 23 Mar 2001 10:46:39 +0800
To: djgpp AT delorie DOT com
From: "Nimrod A. Abing" <n_abing AT ns DOT roxas-online DOT net DOT ph>
Subject: Re: DJGPP and the C++ standard
Cc: cbarry AT pangea DOT ca
In-Reply-To: <3aba8686_2@news4.newsfeeds.com>
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

At 05:15 PM 03/22/2001 -0600, you wrote:
>Short and simple; here's the code. At compile time, I get the error at the
>bottom. I posted this at comp.lang.c++ for help, and everyone compiled it
>just fine. So I'm gonna guess it's a DJGPP thing. Perhaps I have an outdated
>version of the compiler's STL or something (my copy of DJGPP was downloaded
>from the official homepage less than a year ago though). This is an example
>program from "The C++ Standard Library" by Nicolai Josuttis (p. 603), if you
>care.

[ snip ]

>   try
>   {
>      sum = MyLib::ReadAndProcessSum(cin);
>   }
>   catch (const ios::failure& error)                           //   <=====
>error right here
>   {
>      cerr << "I/O exception: " << error.what() << endl;
>      return EXIT_FAILURE;
>   }

[ snip ]

> .... that one doesn't. Any help? Thanks.

>Compiling: Summain.cpp
>In function `int main()':
>Summain.cpp (20) Error: parse error before `&'
>Summain.cpp (24) Error: confused by earlier errors; bailing out
>There were some errors

Perhaps the following excerpt from streambuf.h can explain:

[ streambuf.h ]

...
the executable file might be covered by the GNU General Public License. */

#ifndef _STREAMBUF_H
#define _STREAMBUF_H
#ifdef __GNUG__
#pragma interface
#endif

/* #define _G_IO_THROW */ /* Not implemented:  ios::failure */

#define _IO_NEW_STREAMS // new optimizated stream representation

extern "C" {
#include <libio.h>
}
//#include <_G_config.h>
#ifdef _G_NEED_STDARG_H
#include <stdarg.h>
#endif
#ifndef _IO_va_list
#define _IO_va_list char *
#endif

...

#ifdef _IO_THROW
    void _throw_failure() const { throw new ios::failure(this); }
#else
    void _throw_failure() const { }
#endif
...

[ streambuf.h ]

Try grepping for IO_FAILURE in /dev/env/DJDIR/lang/cxx and you'll see the
reason why ios::failure fails to compile.

HTH. Bye.

nimrod_a_abing
--------------

+========================================+
|  Home page: www.geocities.com/n_abing  |
+========================================+

"Tinimbang ka ngunit kulang."
If you understand that phrase, i-email mo'ko. ;-)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019