gfortran.h (MAX_ERROR_MESSAGE): Remove.
authorJakub Jelinek <jakub@redhat.com>
Thu, 14 Jul 2005 10:12:17 +0000 (12:12 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 14 Jul 2005 10:12:17 +0000 (12:12 +0200)
commitd71b89ca60e6546aaef903c22c6459b592f934d4
treec2963bb336cabb4f3f780c2faf9a7041c131dbc1
parentcb1119b785be0b910b6c7a9e2ee1f0338badf579
gfortran.h (MAX_ERROR_MESSAGE): Remove.

* gfortran.h (MAX_ERROR_MESSAGE): Remove.
(gfc_error_buf): Add allocated and index fields.  Change message
field from array to a pointer.
* error.c (use_warning_buffer, error_ptr, warning_ptr): Remove.
(cur_error_buffer): New variable.
(error_char): Use cur_error_buffer->{message,index} instead of
{warning,error}_{buffer.message,ptr}.  Reallocate message buffer
if too small.
(gfc_warning, gfc_notify_std, gfc_error, gfc_error_now): Setup
cur_error_buffer and its index rather than {warning,error}_ptr
and use_warning_buffer.
(gfc_warning_check, gfc_error_check): Don't print anything if
message is NULL.
(gfc_push_error): Allocate saved message with xstrdup.
(gfc_pop_error): Free saved message with gfc_free.
(gfc_free_error): New function.
* primary.c (match_complex_constant): Call gfc_free_error if
gfc_pop_error will not be called.
* match.c (gfc_match_st_function): Likewise.

* gfortran.dg/g77/cpp6.f: New test.

From-SVN: r102015
gcc/fortran/ChangeLog
gcc/fortran/error.c
gcc/fortran/gfortran.h
gcc/fortran/match.c
gcc/fortran/primary.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/g77/cpp6.f [new file with mode: 0644]