Thread overview
Exceptions
Mar 21, 2002
Rajiv Bhagwat
Mar 21, 2002
Walter
Mar 22, 2002
Rajiv Bhagwat
Mar 22, 2002
Walter
Mar 22, 2002
Walter
Mar 25, 2002
Rajiv Bhagwat
March 21, 2002
The following program catches exceptions properly when compiled for 32
bits(-mn), but just prints 'abnormal program termination' for 16 bit
compiles (-ml).

#include <stdio.h>
int main(int argc,char *argv[]){
    try {
        throw "here it comes";
        }
    catch (const char *e) {
        printf("Exception: %s", e);
        }
    catch (...){
        printf("oh oh");
        }
    return 0;
    }

How about a quick fix?



March 21, 2002
I just ran it (under XP) compiled as:
    sc test -Ae -ml
and it works as expected. I don't know why it isn't working for you.

-Walter

"Rajiv Bhagwat" <dataflow@vsnl.com> wrote in message news:a7cnar$gs8$1@digitaldaemon.com...
> The following program catches exceptions properly when compiled for 32
> bits(-mn), but just prints 'abnormal program termination' for 16 bit
> compiles (-ml).
>
> #include <stdio.h>
> int main(int argc,char *argv[]){
>     try {
>         throw "here it comes";
>         }
>     catch (const char *e) {
>         printf("Exception: %s", e);
>         }
>     catch (...){
>         printf("oh oh");
>         }
>     return 0;
>     }
>
> How about a quick fix?
>
>
>


March 22, 2002
It is failing under Win98 SE. With lots of (other) problems reported for XP, the chances of me switching over to XP immediately are slim.

And I know you don't have Win98! What to do now?

- Rajiv

"Walter" <walter@digitalmars.com> wrote in message news:a7d61b$pae$1@digitaldaemon.com...
> I just ran it (under XP) compiled as:
>     sc test -Ae -ml
> and it works as expected. I don't know why it isn't working for you.
>
> -Walter
>
> "Rajiv Bhagwat" <dataflow@vsnl.com> wrote in message news:a7cnar$gs8$1@digitaldaemon.com...
> > The following program catches exceptions properly when compiled for 32
> > bits(-mn), but just prints 'abnormal program termination' for 16 bit
> > compiles (-ml).
> >
> > #include <stdio.h>
> > int main(int argc,char *argv[]){
> >     try {
> >         throw "here it comes";
> >         }
> >     catch (const char *e) {
> >         printf("Exception: %s", e);
> >         }
> >     catch (...){
> >         printf("oh oh");
> >         }
> >     return 0;
> >     }
> >
> > How about a quick fix?
> >
> >
> >
>
>


March 22, 2002
Try putting fflush(stdout) after each printf.

"Rajiv Bhagwat" <dataflow@vsnl.com> wrote in message news:a7f7mv$1qkj$1@digitaldaemon.com...
> It is failing under Win98 SE. With lots of (other) problems reported for
XP,
> the chances of me switching over to XP immediately are slim.
>
> And I know you don't have Win98! What to do now?
>
> - Rajiv
>
> "Walter" <walter@digitalmars.com> wrote in message news:a7d61b$pae$1@digitaldaemon.com...
> > I just ran it (under XP) compiled as:
> >     sc test -Ae -ml
> > and it works as expected. I don't know why it isn't working for you.
> >
> > -Walter
> >
> > "Rajiv Bhagwat" <dataflow@vsnl.com> wrote in message news:a7cnar$gs8$1@digitaldaemon.com...
> > > The following program catches exceptions properly when compiled for 32
> > > bits(-mn), but just prints 'abnormal program termination' for 16 bit
> > > compiles (-ml).
> > >
> > > #include <stdio.h>
> > > int main(int argc,char *argv[]){
> > >     try {
> > >         throw "here it comes";
> > >         }
> > >     catch (const char *e) {
> > >         printf("Exception: %s", e);
> > >         }
> > >     catch (...){
> > >         printf("oh oh");
> > >         }
> > >     return 0;
> > >     }
> > >
> > > How about a quick fix?
> > >
> > >
> > >
> >
> >
>
>


March 22, 2002
Ok, I found a win98 machine and tried it, and it works as expected. I don't know why it fails for you. -Walter

"Rajiv Bhagwat" <dataflow@vsnl.com> wrote in message news:a7f7mv$1qkj$1@digitaldaemon.com...
> It is failing under Win98 SE. With lots of (other) problems reported for
XP,
> the chances of me switching over to XP immediately are slim.
>
> And I know you don't have Win98! What to do now?
>
> - Rajiv
>
> "Walter" <walter@digitalmars.com> wrote in message news:a7d61b$pae$1@digitaldaemon.com...
> > I just ran it (under XP) compiled as:
> >     sc test -Ae -ml
> > and it works as expected. I don't know why it isn't working for you.
> >
> > -Walter
> >
> > "Rajiv Bhagwat" <dataflow@vsnl.com> wrote in message news:a7cnar$gs8$1@digitaldaemon.com...
> > > The following program catches exceptions properly when compiled for 32
> > > bits(-mn), but just prints 'abnormal program termination' for 16 bit
> > > compiles (-ml).
> > >
> > > #include <stdio.h>
> > > int main(int argc,char *argv[]){
> > >     try {
> > >         throw "here it comes";
> > >         }
> > >     catch (const char *e) {
> > >         printf("Exception: %s", e);
> > >         }
> > >     catch (...){
> > >         printf("oh oh");
> > >         }
> > >     return 0;
> > >     }
> > >
> > > How about a quick fix?
> > >
> > >
> > >
> >
> >
>
>


March 25, 2002
Walter, thanks for solving the problem. Removing -Nc from the CFLAGS does
make the program work as expected.
- Rajiv


"Walter" <walter@digitalmars.com> wrote in message news:a7ftmf$1ij2$1@digitaldaemon.com...
> Ok, I found a win98 machine and tried it, and it works as expected. I
don't
> know why it fails for you. -Walter
>
> "Rajiv Bhagwat" <dataflow@vsnl.com> wrote in message news:a7f7mv$1qkj$1@digitaldaemon.com...
> > It is failing under Win98 SE. With lots of (other) problems reported for
> XP,
> > the chances of me switching over to XP immediately are slim.
> >
> > And I know you don't have Win98! What to do now?
> >
> > - Rajiv
> >
> > "Walter" <walter@digitalmars.com> wrote in message news:a7d61b$pae$1@digitaldaemon.com...
> > > I just ran it (under XP) compiled as:
> > >     sc test -Ae -ml
> > > and it works as expected. I don't know why it isn't working for you.
> > >
> > > -Walter
> > >
> > > "Rajiv Bhagwat" <dataflow@vsnl.com> wrote in message news:a7cnar$gs8$1@digitaldaemon.com...
> > > > The following program catches exceptions properly when compiled for
32
> > > > bits(-mn), but just prints 'abnormal program termination' for 16 bit
> > > > compiles (-ml).
> > > >
> > > > #include <stdio.h>
> > > > int main(int argc,char *argv[]){
> > > >     try {
> > > >         throw "here it comes";
> > > >         }
> > > >     catch (const char *e) {
> > > >         printf("Exception: %s", e);
> > > >         }
> > > >     catch (...){
> > > >         printf("oh oh");
> > > >         }
> > > >     return 0;
> > > >     }
> > > >
> > > > How about a quick fix?
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>