summaryrefslogtreecommitdiff
path: root/gcc/real.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-01-27 01:43:17 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-01-27 01:43:17 +0000
commitbe2828ce3a45f1a520b7d3e932b1fead7462ec7e (patch)
treee7daf0f28ecb5da9660b21aee68e6919f846c183 /gcc/real.c
parent6bc988cda5e493c3e632a2d82be7ea8763a618e2 (diff)
downloadgcc-be2828ce3a45f1a520b7d3e932b1fead7462ec7e.tar.gz
Merge in gcc2 snapshot 19980929. See gcc/ChangeLog and gcc/FSFChangeLog for
details. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@24879 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/real.c')
-rw-r--r--gcc/real.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/gcc/real.c b/gcc/real.c
index 6f8e06a87f3..631bee01807 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -5655,7 +5655,6 @@ eiremain (den, num)
}
/* Report an error condition CODE encountered in function NAME.
- CODE is one of the following:
Mnemonic Value Significance
@@ -5672,19 +5671,6 @@ eiremain (den, num)
The order of appearance of the following messages is bound to the
error codes defined above. */
-#define NMSGS 8
-static char *ermsg[NMSGS] =
-{
- "unknown", /* error code 0 */
- "domain error", /* error code 1 */
- "singularity", /* et seq. */
- "overflow",
- "underflow",
- "total loss of precision",
- "partial loss of precision",
- "`not-a-number' produced"
-};
-
int merror = 0;
extern int merror;
@@ -5693,14 +5679,10 @@ mtherr (name, code)
char *name;
int code;
{
- char errstr[80];
-
/* The string passed by the calling program is supposed to be the
name of the function in which the error occurred.
The code argument selects which error message string will be printed. */
- if ((code <= 0) || (code >= NMSGS))
- code = 0;
if (strcmp (name, "esub") == 0)
name = "subtraction";
else if (strcmp (name, "ediv") == 0)
@@ -5717,9 +5699,21 @@ mtherr (name, code)
name = "modulus";
else if (strcmp (name, "esqrt") == 0)
name = "square root";
- sprintf (errstr, "%s during real %s", ermsg[code], name);
if (extra_warnings)
- warning (errstr);
+ {
+ switch (code)
+ {
+ case DOMAIN: warning ("%s: argument domain error" , name); break;
+ case SING: warning ("%s: function singularity" , name); break;
+ case OVERFLOW: warning ("%s: overflow range error" , name); break;
+ case UNDERFLOW: warning ("%s: underflow range error" , name); break;
+ case TLOSS: warning ("%s: total loss of precision" , name); break;
+ case PLOSS: warning ("%s: partial loss of precision", name); break;
+ case INVALID: warning ("%s: NaN - producing operation", name); break;
+ default: abort ();
+ }
+ }
+
/* Set global error message word */
merror = code + 1;
}