delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/30/15:11:44

Message-ID: <370121EB.33506B4E@jps.net>
Date: Tue, 30 Mar 1999 11:11:39 -0800
From: Dennis Yelle <dennis51 AT jps DOT net>
X-Mailer: Mozilla 4.51 [en] (Win95; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: try, throw, and catch
NNTP-Posting-Host: 209.239.194.169
X-NNTP-Posting-Host: 209.239.194.169
X-Trace: 30 Mar 1999 19:33:00 -0800, 209.239.194.169
Lines: 35
X-NNTP-Posting-Host: 209.63.224.240
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

When I compile this program:

---------- cut here for bug.cpp -------------------
#include <iostream.h>
#include <string.h>

struct sorry{
    const char *error_msg;
    sorry( const char *p) : error_msg(p) {}
};

int main()
{
    try {
        throw sorry( "test 3");
    }
    catch ( sorry stuff ) {
        cerr << "Sorry, ";
        cerr << stuff.error_msg ;
        cerr << '\n';
    }
    cout << '\n';
}
---------- cut here for bug.cpp -------------------

with gxx version 2.8.1
using this:
   gxx -g -Wall bug.cpp -o bug.exe
I get this:
  bug.cpp: In function `int main()':
  bug.cpp:14: warning: value computed is not used
  
Can someone tell me which value is not used?

Dennis Yelle

- Raw text -


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