mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-29 06:44:27 +08:00
[multiple changes]
2000-06-01 Zack Weinberg <zack@wolery.cumb.org> * cpplex.c (maybe_macroexpand): Use CPP_WTRADITIONAL. Improve error message. * cpplib.c (parse_include): Remove support for VAX-C "#include starlet" misfeature. * gcc.dg/cpp-tradwarn2.c: Update egrep pattern. 2000-05-31 Laurynas Biveinis <lauras@softhome.net> * cppfiles.c: conditionally define O_BINARY. (open_include_file): pass O_BINARY to open(). From-SVN: r34344
This commit is contained in:
parent
0ba154aa23
commit
d7a2e0f70b
@ -1,3 +1,15 @@
|
||||
2000-06-01 Zack Weinberg <zack@wolery.cumb.org>
|
||||
|
||||
* cpplex.c (maybe_macroexpand): Use CPP_WTRADITIONAL. Improve
|
||||
error message.
|
||||
* cpplib.c (parse_include): Remove support for VAX-C
|
||||
"#include starlet" misfeature.
|
||||
|
||||
2000-05-31 Laurynas Biveinis <lauras@softhome.net>
|
||||
|
||||
* cppfiles.c: conditionally define O_BINARY.
|
||||
(open_include_file): pass O_BINARY to open().
|
||||
|
||||
2000-06-01 Richard Henderson <rth@cygnus.com>
|
||||
|
||||
* i960.c (i960_br_predict_opcode): Remove.
|
||||
|
@ -39,6 +39,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
# define MMAP_THRESHOLD 0
|
||||
#endif
|
||||
|
||||
#ifndef O_BINARY
|
||||
# define O_BINARY 0
|
||||
#endif
|
||||
|
||||
static IHASH *redundant_include_p PARAMS ((IHASH *, struct file_name_list *));
|
||||
static IHASH *make_IHASH PARAMS ((const char *, const char *,
|
||||
struct file_name_list *,
|
||||
@ -216,14 +220,18 @@ make_IHASH (name, fname, path, hash, slot)
|
||||
paranoia is a virtue).
|
||||
|
||||
Use the three-argument form of open even though we aren't
|
||||
specifying O_CREAT, to defend against broken system headers. */
|
||||
specifying O_CREAT, to defend against broken system headers.
|
||||
|
||||
O_BINARY tells some runtime libraries (notably DJGPP) not to do
|
||||
newline translation; we can handle DOS line breaks just fine
|
||||
ourselves. */
|
||||
|
||||
static inline int
|
||||
open_include_file (pfile, filename)
|
||||
cpp_reader *pfile ATTRIBUTE_UNUSED;
|
||||
const char *filename;
|
||||
{
|
||||
return open (filename, O_RDONLY|O_NOCTTY, 0666);
|
||||
return open (filename, O_RDONLY|O_NOCTTY|O_BINARY, 0666);
|
||||
}
|
||||
|
||||
/* Search for include file FNAME in the include chain starting at
|
||||
|
@ -1699,9 +1699,9 @@ maybe_macroexpand (pfile, written)
|
||||
CPP_PUTC (pfile, ' ');
|
||||
|
||||
/* K+R treated this as a hard error. */
|
||||
if (CPP_OPTION (pfile, warn_traditional))
|
||||
if (CPP_WTRADITIONAL (pfile))
|
||||
cpp_warning (pfile,
|
||||
"traditional C rejects function macro %s in non-function context",
|
||||
"function macro %s must be used with arguments in traditional C",
|
||||
hp->name);
|
||||
return 0;
|
||||
}
|
||||
|
22
gcc/cpplib.c
22
gcc/cpplib.c
@ -411,27 +411,7 @@ parse_include (pfile, name)
|
||||
|
||||
len = CPP_WRITTEN (pfile) - old_written;
|
||||
|
||||
if (token == CPP_STRING)
|
||||
; /* No special treatment required. */
|
||||
#ifdef VMS
|
||||
else if (token == CPP_NAME)
|
||||
{
|
||||
/* Support '#include xyz' like VAX-C. It is taken as
|
||||
'#include <xyz.h>' and generates a warning. */
|
||||
cpp_warning (pfile, "#%s filename is obsolete, use #%s <filename.h>",
|
||||
name, name);
|
||||
|
||||
/* Rewrite the token to <xyz.h>. */
|
||||
CPP_RESERVE (pfile, 4);
|
||||
len += 4;
|
||||
memmove (pfile->token_buffer + old_written + 1,
|
||||
pfile->token_buffer + old_written,
|
||||
CPP_WRITTEN (pfile) - old_written);
|
||||
pfile->token_buffer[old_written] = '<';
|
||||
CPP_PUTS_Q (pfile, ".h>", 2);
|
||||
}
|
||||
#endif
|
||||
else
|
||||
if (token != CPP_STRING)
|
||||
{
|
||||
cpp_error (pfile, "#%s expects \"FILENAME\" or <FILENAME>", name);
|
||||
CPP_SET_WRITTEN (pfile, old_written);
|
||||
|
@ -1,3 +1,7 @@
|
||||
2000-06-01 Zack Weinberg <zack@wolery.cumb.org>
|
||||
|
||||
* gcc.dg/cpp-tradwarn2.c: Update egrep pattern.
|
||||
|
||||
2000-05-29 Zack Weinberg <zack@wolery.cumb.org>
|
||||
|
||||
* gcc.dg/cpp-mi.c: Add another case, cpp-mix.h, where the
|
||||
|
@ -10,5 +10,5 @@ enum { SIGN_EXTEND = 23 };
|
||||
|
||||
int fun(void)
|
||||
{
|
||||
return SIGN_EXTEND; /* { dg-warning "in non-function context" } */
|
||||
return SIGN_EXTEND; /* { dg-warning "must be used with arguments" } */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user