bad.c: Include intl.h.
* bad.c: Include intl.h. (FFEBAD_MSGS1, FFEBAD_MSGS2): Replace by FFEBAD_MSG, SHORT, LONG. Adjust definitions to work with exgettext. (ffebad_start_): Translate all error messages. (ffebad_finish): Mark constant strings for translation. * bad.h: Use FFEBAD_MSG. Adjust prototype of ffebad_start_ and definitions of ffebad_start_msg, ffebad_start_msg_lex to work with exgettext. * bad.def: Use FFEBAD_MSG, SHORT, LONG throughout. * com.c: Include intl.h. (lang_print_error_function): Always use ffeinfo_kind_message to get the kind label for a non-nested construct. Translate it. Translate constant strings. * info.c (FFEINFO_KIND): Adjust definition to work with exgettext. * info-k.def: Block xgettext from slurping copyright notice into gcc.pot. Adjust strings for their sole use, in com.c. * Make-lang.in (f/bad.o, f/com.o): Depend on intl.h. From-SVN: r49123
This commit is contained in:
parent
bd571ffcd0
commit
f1685b7c17
|
@ -1,8 +1,30 @@
|
|||
2001-01-14 David Billinghurst <David.Billinghurst@riotinto.com>
|
||||
2002-01-22 Zack Weinberg <zack@codesourcery.com>
|
||||
|
||||
PR fortran/3807
|
||||
* f/intrin.c (ffeintrin_check_): Allow for case of intrinsic
|
||||
control string have COL-spec an integer > 0.
|
||||
* bad.c: Include intl.h.
|
||||
(FFEBAD_MSGS1, FFEBAD_MSGS2): Replace by FFEBAD_MSG, SHORT,
|
||||
LONG. Adjust definitions to work with exgettext.
|
||||
(ffebad_start_): Translate all error messages.
|
||||
(ffebad_finish): Mark constant strings for translation.
|
||||
* bad.h: Use FFEBAD_MSG. Adjust prototype of ffebad_start_
|
||||
and definitions of ffebad_start_msg, ffebad_start_msg_lex to
|
||||
work with exgettext.
|
||||
* bad.def: Use FFEBAD_MSG, SHORT, LONG throughout.
|
||||
|
||||
* com.c: Include intl.h.
|
||||
(lang_print_error_function): Always use ffeinfo_kind_message
|
||||
to get the kind label for a non-nested construct. Translate
|
||||
it. Translate constant strings.
|
||||
* info.c (FFEINFO_KIND): Adjust definition to work with exgettext.
|
||||
* info-k.def: Block xgettext from slurping copyright notice
|
||||
into gcc.pot. Adjust strings for their sole use, in com.c.
|
||||
|
||||
* Make-lang.in (f/bad.o, f/com.o): Depend on intl.h.
|
||||
|
||||
2002-01-14 David Billinghurst <David.Billinghurst@riotinto.com>
|
||||
|
||||
PR fortran/3807
|
||||
* f/intrin.c (ffeintrin_check_): Allow for case of intrinsic
|
||||
control string have COL-spec an integer > 0.
|
||||
|
||||
2002-01-08 Joseph S. Myers <jsm28@cam.ac.uk>
|
||||
|
||||
|
@ -46,7 +68,7 @@ Sun Dec 16 16:08:57 2001 Joseph S. Myers <jsm28@cam.ac.uk>
|
|||
Sun Dec 16 10:36:51 2001 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||
|
||||
* Make-lang.in (f/version.o): Depend on f/version.h.
|
||||
* version.c: Include ansidecl.h and f/version.h.
|
||||
* version.c: Include ansidecl.h and f/version.h.
|
||||
|
||||
Sun Dec 16 08:52:48 2001 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||
|
||||
|
|
|
@ -350,7 +350,7 @@ f/bad.o: f/bad.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/bad.h f/bad.def f/where.h \
|
|||
glimits.h f/top.h f/malloc.h flags.h f/com.h f/com-rt.def $(TREE_H) f/bld.h \
|
||||
f/bld-op.def f/bit.h f/info.h f/info-b.def f/info-k.def f/info-w.def \
|
||||
f/target.h f/lex.h f/type.h f/intrin.h f/intrin.def f/lab.h f/symbol.h \
|
||||
f/symbol.def f/equiv.h f/storag.h f/global.h f/name.h toplev.h
|
||||
f/symbol.def f/equiv.h f/storag.h f/global.h f/name.h toplev.h intl.h
|
||||
f/bit.o: f/bit.c f/proj.h $(CONFIG_H) $(SYSTEM_H) glimits.h f/bit.h \
|
||||
f/malloc.h
|
||||
f/bld.o: f/bld.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/bld.h f/bld-op.def f/bit.h \
|
||||
|
@ -364,7 +364,7 @@ f/com.o: f/com.c f/proj.h $(CONFIG_H) $(SYSTEM_H) flags.h $(RTL_H) $(TREE_H) \
|
|||
f/bad.def f/where.h glimits.h f/top.h f/lex.h f/type.h f/intrin.h \
|
||||
f/intrin.def f/lab.h f/symbol.h f/symbol.def f/equiv.h f/storag.h f/global.h \
|
||||
f/name.h f/expr.h f/implic.h f/src.h f/st.h $(GGC_H) toplev.h diagnostic.h \
|
||||
langhooks.h langhooks-def.h
|
||||
langhooks.h langhooks-def.h intl.h
|
||||
f/data.o: f/data.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/data.h f/bld.h f/bld-op.def \
|
||||
f/bit.h f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def \
|
||||
f/info-k.def f/info-w.def f/target.h f/bad.h f/bad.def f/where.h glimits.h \
|
||||
|
|
38
gcc/f/bad.c
38
gcc/f/bad.c
|
@ -1,5 +1,5 @@
|
|||
/* bad.c -- Implementation File (module.c template V1.0)
|
||||
Copyright (C) 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995, 2002 Free Software Foundation, Inc.
|
||||
Contributed by James Craig Burley.
|
||||
|
||||
This file is part of GNU Fortran.
|
||||
|
@ -42,6 +42,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|||
#include "com.h"
|
||||
#include "toplev.h"
|
||||
#include "where.h"
|
||||
#include "intl.h"
|
||||
|
||||
/* Externals defined here. */
|
||||
|
||||
|
@ -70,15 +71,18 @@ struct _ffebad_message_
|
|||
static const struct _ffebad_message_ ffebad_messages_[]
|
||||
=
|
||||
{
|
||||
#define FFEBAD_MSGS1(KWD,SEV,MSG) { SEV, MSG },
|
||||
#define FFEBAD_MSG(kwd,sev,msgid) { sev, msgid },
|
||||
#if FFEBAD_LONG_MSGS_ == 0
|
||||
#define FFEBAD_MSGS2(KWD,SEV,LMSG,SMSG) { SEV, SMSG },
|
||||
#define LONG(m)
|
||||
#define SHORT(m) m
|
||||
#else
|
||||
#define FFEBAD_MSGS2(KWD,SEV,LMSG,SMSG) { SEV, LMSG },
|
||||
#define LONG(m) m
|
||||
#define SHORT(m)
|
||||
#endif
|
||||
#include "bad.def"
|
||||
#undef FFEBAD_MSGS1
|
||||
#undef FFEBAD_MSGS2
|
||||
#undef FFEBAD_MSG
|
||||
#undef LONG
|
||||
#undef SHORT
|
||||
};
|
||||
|
||||
static struct
|
||||
|
@ -161,7 +165,7 @@ ffebad_severity (ffebad errnum)
|
|||
|
||||
bool
|
||||
ffebad_start_ (bool lex_override, ffebad errnum, ffebadSeverity sev,
|
||||
const char *message)
|
||||
const char *msgid)
|
||||
{
|
||||
unsigned char i;
|
||||
|
||||
|
@ -174,12 +178,12 @@ ffebad_start_ (bool lex_override, ffebad errnum, ffebadSeverity sev,
|
|||
if (errnum != FFEBAD)
|
||||
{
|
||||
ffebad_severity_ = ffebad_messages_[errnum].severity;
|
||||
ffebad_message_ = ffebad_messages_[errnum].message;
|
||||
ffebad_message_ = gettext (ffebad_messages_[errnum].message);
|
||||
}
|
||||
else
|
||||
{
|
||||
ffebad_severity_ = sev;
|
||||
ffebad_message_ = message;
|
||||
ffebad_message_ = gettext (msgid);
|
||||
}
|
||||
|
||||
switch (ffebad_severity_)
|
||||
|
@ -379,15 +383,15 @@ ffebad_finish ()
|
|||
switch (ffebad_severity_)
|
||||
{
|
||||
case FFEBAD_severityINFORMATIONAL:
|
||||
s = "note:";
|
||||
s = _("note:");
|
||||
break;
|
||||
|
||||
case FFEBAD_severityWARNING:
|
||||
s = "warning:";
|
||||
s = _("warning:");
|
||||
break;
|
||||
|
||||
case FFEBAD_severitySEVERE:
|
||||
s = "fatal:";
|
||||
s = _("fatal:");
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -429,7 +433,7 @@ ffebad_finish ()
|
|||
pointer);
|
||||
last_line_num = ln;
|
||||
last_col_num = cn;
|
||||
s = "(continued):";
|
||||
s = _("(continued):");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -479,14 +483,14 @@ ffebad_finish ()
|
|||
|
||||
if ((index < 0) || (index >= FFEBAD_MAX_))
|
||||
{
|
||||
bufi = ffebad_bufputs_ (buf, bufi, "[REPORT BUG!!] %");
|
||||
bufi = ffebad_bufputs_ (buf, bufi, _("[REPORT BUG!!] %"));
|
||||
bufi = ffebad_bufputc_ (buf, bufi, c);
|
||||
}
|
||||
else
|
||||
{
|
||||
s = ffebad_string_[index];
|
||||
if (s == NULL)
|
||||
bufi = ffebad_bufputs_ (buf, bufi, "[REPORT BUG!!]");
|
||||
bufi = ffebad_bufputs_ (buf, bufi, _("[REPORT BUG!!]"));
|
||||
else
|
||||
bufi = ffebad_bufputs_ (buf, bufi, s);
|
||||
}
|
||||
|
@ -497,7 +501,7 @@ ffebad_finish ()
|
|||
|
||||
if ((index < 0) || (index >= FFEBAD_MAX_))
|
||||
{
|
||||
bufi = ffebad_bufputs_ (buf, bufi, "[REPORT BUG!!] %");
|
||||
bufi = ffebad_bufputs_ (buf, bufi, _("[REPORT BUG!!] %"));
|
||||
bufi = ffebad_bufputc_ (buf, bufi, c);
|
||||
}
|
||||
else
|
||||
|
@ -518,7 +522,7 @@ ffebad_finish ()
|
|||
bufi = ffebad_bufputc_ (buf, bufi, '%');
|
||||
else
|
||||
{
|
||||
bufi = ffebad_bufputs_ (buf, bufi, "[REPORT BUG!!]");
|
||||
bufi = ffebad_bufputs_ (buf, bufi, _("[REPORT BUG!!]"));
|
||||
bufi = ffebad_bufputc_ (buf, bufi, '%');
|
||||
bufi = ffebad_bufputc_ (buf, bufi, c);
|
||||
}
|
||||
|
|
990
gcc/f/bad.def
990
gcc/f/bad.def
File diff suppressed because it is too large
Load Diff
14
gcc/f/bad.h
14
gcc/f/bad.h
|
@ -1,5 +1,5 @@
|
|||
/* bad.h -- Public #include File (module.h template V1.0)
|
||||
Copyright (C) 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995, 2002 Free Software Foundation, Inc.
|
||||
Contributed by James Craig Burley.
|
||||
|
||||
This file is part of GNU Fortran.
|
||||
|
@ -34,11 +34,9 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|||
|
||||
typedef enum
|
||||
{
|
||||
#define FFEBAD_MSGS1(KWD,SEV,MSG) KWD,
|
||||
#define FFEBAD_MSGS2(KWD,SEV,LMSG,SMSG) KWD,
|
||||
#define FFEBAD_MSG(KWD,SEV,MSG) KWD,
|
||||
#include "bad.def"
|
||||
#undef FFEBAD_MSGS1
|
||||
#undef FFEBAD_MSGS2
|
||||
#undef FFEBAD_MSG
|
||||
FFEBAD
|
||||
} ffebad;
|
||||
|
||||
|
@ -82,7 +80,7 @@ void ffebad_init_0 (void);
|
|||
bool ffebad_is_fatal (ffebad errnum);
|
||||
ffebadSeverity ffebad_severity (ffebad errnum);
|
||||
bool ffebad_start_ (bool lex_override, ffebad errnum, ffebadSeverity sev,
|
||||
const char *message);
|
||||
const char *msgid);
|
||||
void ffebad_string (const char *string);
|
||||
|
||||
/* Define macros. */
|
||||
|
@ -95,8 +93,8 @@ void ffebad_string (const char *string);
|
|||
#define ffebad_set_inhibit(f) (ffebad_is_inhibited_ = (f))
|
||||
#define ffebad_start(e) ffebad_start_ (FALSE, (e), FFEBAD_severity, NULL)
|
||||
#define ffebad_start_lex(e) ffebad_start_ (TRUE, (e), FFEBAD_severity, NULL)
|
||||
#define ffebad_start_msg(m,s) ffebad_start_ (FALSE, FFEBAD, (s), (m))
|
||||
#define ffebad_start_msg_lex(m,s) ffebad_start_ (TRUE, FFEBAD, (s), (m))
|
||||
#define ffebad_start_msg(msgid,s) ffebad_start_ (FALSE, FFEBAD, (s), (msgid))
|
||||
#define ffebad_start_msg_lex(msgid,s) ffebad_start_ (TRUE, FFEBAD, (s), (msgid))
|
||||
#define ffebad_terminate_0()
|
||||
#define ffebad_terminate_1()
|
||||
#define ffebad_terminate_2()
|
||||
|
|
30
gcc/f/com.c
30
gcc/f/com.c
|
@ -89,6 +89,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|||
#include "convert.h"
|
||||
#include "ggc.h"
|
||||
#include "diagnostic.h"
|
||||
#include "intl.h"
|
||||
#include "langhooks.h"
|
||||
#include "langhooks-def.h"
|
||||
|
||||
|
@ -13669,33 +13670,12 @@ lang_print_error_function (diagnostic_context *context __attribute__((unused)),
|
|||
if (ffecom_nested_entry_ == NULL)
|
||||
{
|
||||
s = ffecom_primary_entry_;
|
||||
switch (ffesymbol_kind (s))
|
||||
{
|
||||
case FFEINFO_kindFUNCTION:
|
||||
kind = "function";
|
||||
break;
|
||||
|
||||
case FFEINFO_kindSUBROUTINE:
|
||||
kind = "subroutine";
|
||||
break;
|
||||
|
||||
case FFEINFO_kindPROGRAM:
|
||||
kind = "program";
|
||||
break;
|
||||
|
||||
case FFEINFO_kindBLOCKDATA:
|
||||
kind = "block-data";
|
||||
break;
|
||||
|
||||
default:
|
||||
kind = ffeinfo_kind_message (ffesymbol_kind (s));
|
||||
break;
|
||||
}
|
||||
kind = _(ffeinfo_kind_message (ffesymbol_kind (s)));
|
||||
}
|
||||
else
|
||||
{
|
||||
s = ffecom_nested_entry_;
|
||||
kind = "statement function";
|
||||
kind = _("In statement function");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13705,12 +13685,12 @@ lang_print_error_function (diagnostic_context *context __attribute__((unused)),
|
|||
fprintf (stderr, "%s: ", file);
|
||||
|
||||
if (s == NULL)
|
||||
fprintf (stderr, "Outside of any program unit:\n");
|
||||
fprintf (stderr, _("Outside of any program unit:\n"));
|
||||
else
|
||||
{
|
||||
const char *name = ffesymbol_text (s);
|
||||
|
||||
fprintf (stderr, "In %s `%s':\n", kind, name);
|
||||
fprintf (stderr, "%s `%s':\n", kind, name);
|
||||
}
|
||||
|
||||
last_g = g;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* info-k.def -- Public #include File (module.h template V1.0)
|
||||
Copyright (C) 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995, 2002 Free Software Foundation, Inc.
|
||||
Contributed by James Craig Burley.
|
||||
|
||||
This file is part of GNU Fortran.
|
||||
|
@ -25,13 +25,17 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|||
Modifications:
|
||||
*/
|
||||
|
||||
FFEINFO_KIND (FFEINFO_kindNONE, "an unknown kind", "")
|
||||
FFEINFO_KIND (FFEINFO_kindENTITY, "an entity", "e")
|
||||
FFEINFO_KIND (FFEINFO_kindFUNCTION, "a function", "f")
|
||||
FFEINFO_KIND (FFEINFO_kindSUBROUTINE, "a subroutine", "u")
|
||||
FFEINFO_KIND (FFEINFO_kindPROGRAM, "a program", "p")
|
||||
FFEINFO_KIND (FFEINFO_kindBLOCKDATA, "a block-data unit", "b")
|
||||
FFEINFO_KIND (FFEINFO_kindCOMMON, "a common block", "c")
|
||||
FFEINFO_KIND (FFEINFO_kindCONSTRUCT, "a construct", ":")
|
||||
FFEINFO_KIND (FFEINFO_kindNAMELIST, "a namelist", "n")
|
||||
FFEINFO_KIND (FFEINFO_kindANY, "anything", "~")
|
||||
#
|
||||
/* Kind messages are used in diagnostic location reports of the
|
||||
form "<file>: In function `foo': <error message>". */
|
||||
|
||||
FFEINFO_KIND (FFEINFO_kindNONE, "In unknown kind", "")
|
||||
FFEINFO_KIND (FFEINFO_kindENTITY, "In entity", "e")
|
||||
FFEINFO_KIND (FFEINFO_kindFUNCTION, "In function", "f")
|
||||
FFEINFO_KIND (FFEINFO_kindSUBROUTINE, "In subroutine", "u")
|
||||
FFEINFO_KIND (FFEINFO_kindPROGRAM, "In program", "p")
|
||||
FFEINFO_KIND (FFEINFO_kindBLOCKDATA, "In block-data unit", "b")
|
||||
FFEINFO_KIND (FFEINFO_kindCOMMON, "In common block", "c")
|
||||
FFEINFO_KIND (FFEINFO_kindCONSTRUCT, "In construct", ":")
|
||||
FFEINFO_KIND (FFEINFO_kindNAMELIST, "In namelist", "n")
|
||||
FFEINFO_KIND (FFEINFO_kindANY, "In anything", "~")
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* info.c -- Implementation File (module.c template V1.0)
|
||||
Copyright (C) 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995, 2002 Free Software Foundation, Inc.
|
||||
Contributed by James Craig Burley.
|
||||
|
||||
This file is part of GNU Fortran.
|
||||
|
@ -65,7 +65,7 @@ static const char *const ffeinfo_basictype_string_[]
|
|||
static const char *const ffeinfo_kind_message_[]
|
||||
=
|
||||
{
|
||||
#define FFEINFO_KIND(KWD,LNAM,SNAM) LNAM,
|
||||
#define FFEINFO_KIND(kwd,msgid,snam) msgid,
|
||||
#include "info-k.def"
|
||||
#undef FFEINFO_KIND
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue