summaryrefslogtreecommitdiff
path: root/gcc/cexp.y
Commit message (Collapse)AuthorAgeFilesLines
* * system.h: Include stdarg.h/varargs.h, make sure they are orderedghazi1998-08-261-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | correctly with regards to stdio.h. * calls.c: Remove stdarg.h/varargs.h. * cccp.c: Likewise. * cexp.y: Likewise. * combine.c: Likewise. * cpperror.c: Likewise. * cpplib.c: Likewise. * cpplib.h: Likewise. * doprint.c: Likewise. * emit-rtl.c: Likewise. * final.c: Likewise. * fix-header.c: Likewise. * gcc.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * gencodes.c: Likewise. * genconfig.c: Likewise. * genemit.c: Likewise. * genextract.c: Likewise. * genflags.c: Likewise. * genopinit.c: Likewise. * genoutput.c: Likewise. * genpeep.c: Likewise. * genrecog.c: Likewise. * mips-tfile.c: Likewise. * prefix.c: Likewise. * protoize.c: Likewise. * regmove.c: Likewise. * toplev.c: Likewise. * tree.c: Likewise. * cp/errfn.c: Remove stdarg.h/varargs.h. * cp/tree.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@21997 138bc75d-0d04-0410-961f-82ee72b054a4
* Mon Jul 20 16:16:38 1998 Dave Brolley <brolley@cygnus.com>brolley1998-07-201-41/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.in (enable_c_mbchar): New configure option. (extra_cpp_objs): Always available now. * cexp.y (mbchar.h): #include it. (yylex): Handle Multibyte characters in character literals. * cccp.c (mbchar.h): #include it. (main): Set character set based on LANG environment variable. (rescan): Handle multibyte characters in comments. (skip_if_group): See above. (validate_else): See above. (skip_to_end_of_comment): See above. (macarg1): See above. (discard_comments): See above. (rescan): Handle multibyte characters in string and character literals. (collect_expansion): See above. (skip_quoted_string): See above. (macroexpand): See above. (macarg1): See above. (discard_comments): See above. (change_newlines): See above. * c-lex.c (mbchar.h): #include it. (GET_ENVIRONMENT): New macro. (init_lex): Set character set based on LANG environment variable. (yylex): Handle multibyte characters in character literals. (yylex): Handle multibyte characters in string literals. * Makefile.in (mbchar.o): New target. (cccp$(exeext)): @extra_cpp_objs@ is always available. (cppmain$(exeext)): @extra_cpp_objs@ is always available. * mbchar.[ch]: New files for multibyte character handling. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@21303 138bc75d-0d04-0410-961f-82ee72b054a4
* Handle missing vfprintf() & _doprnt() functions with linked in modules,ghazi1998-05-071-53/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | plus do some general cleanup of variable argument handling. * aclocal.m4 (GCC_FUNC_VFPRINTF_DOPRNT): New macro. * configure.in: Add a call to GCC_FUNC_VFPRINTF_DOPRNT. (AC_CHECK_HEADERS): Remove unused check for varargs.h,sys/varargs.h. (AC_CHECK_FUNCS): Remove unused check for vprintf. * Makefile.in: Add support for linking in vfprintf.c and doprint.c. (cccp.o): Depend on gansidecl.h. (cexp.o): Likewise. * cccp.c: Convert from using PRINTF_ALIST/PRINTF_DCL to VPROTO as per the rest of gcc source. * cexp.y: Likewise. Include gansidecl.h and remove all code made redundant. * cccp.c: Remove checks for HAVE_VPRINTF and the associated code used when vfprintf is missing. * cexp.y: Likewise. * gcc.c: Likewise. * genattrtab.c: Likewise. * mips-tfile.c: Likewise. * toplev.c: Likewise. * vfprintf.c: New file. * doprint.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19610 138bc75d-0d04-0410-961f-82ee72b054a4
* More system.h cutover patches:ghazi1998-04-061-39/+25
| | | | | | | | | | | | | * c-parse.in: Include system.h, and remove stuff now made redundant. * cccp.c: Likewise. * cexp.y: Likewise. * protoize.c: Likewise. Properly check for cpp stringification. * Makefile.in (c-parse.o, cccp.o, cexp.o, protoize.o, unprotoize.o): Depend on system.h. * objc/Make-lang.in (objc-parse.o): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19020 138bc75d-0d04-0410-961f-82ee72b054a4
* dummy commit before mergelaw1998-04-031-64/+104
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18980 138bc75d-0d04-0410-961f-82ee72b054a4
* cexp.y (warn_undef): New variable.kenner1997-04-131-1/+7
| | | | | | | (exp): Optionally warn about undefined identifiers that evaluate to 0. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13877 138bc75d-0d04-0410-961f-82ee72b054a4
* (parse_number, yylex), cccp.c (rescan), cpplib.ckenner1997-03-191-2/+7
| | | | | | | | (cpp_get_token): Unless -lang-c89 is specified, allow C9X-style hexadecimal floating-point numbers as preprocessor numbers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13746 138bc75d-0d04-0410-961f-82ee72b054a4
* (parse_number): Invalid integer constants are errors if pedantic.kenner1997-03-171-3/+3
| | | | | | | (yylex): Invalid multibyte characters are errors if pedantic. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13725 138bc75d-0d04-0410-961f-82ee72b054a4
* (parse_c_expression): Don't check for null lexptr or *lexptr == 0. Ifkenner1997-02-161-8/+3
| | | | | | | yyparse returns nonzero value, abort. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13655 138bc75d-0d04-0410-961f-82ee72b054a4
* (yylex): Use is_space, not is_hor_space, to find keyword end.kenner1997-02-161-8/+10
| | | | | | | | (is_space): New decl. (is_hor_space): Removed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13654 138bc75d-0d04-0410-961f-82ee72b054a4
* #define __attribute__ to be null if compiling with GCC older than 2.7,kenner1997-01-191-1/+1
| | | | | | | not 2.6. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13522 138bc75d-0d04-0410-961f-82ee72b054a4
* (PRINTF_PROTO): Use __printf__ in __attribute__, not printf.kenner1997-01-041-3/+3
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13362 138bc75d-0d04-0410-961f-82ee72b054a4
* (yylex): Cast string literal to U_CHAR* for lookup() call.kenner1996-10-231-1/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13014 138bc75d-0d04-0410-961f-82ee72b054a4
* (initialize_random_junk): Ignore DOLLARS_IN_IDENTIFIERS.kenner1996-10-091-2/+0
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@12933 138bc75d-0d04-0410-961f-82ee72b054a4
* formatting tweaksmrs1996-07-031-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@12390 138bc75d-0d04-0410-961f-82ee72b054a4
* (parse_number): Don't reject long long constants unless pedantic.kenner1996-04-101-3/+3
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11689 138bc75d-0d04-0410-961f-82ee72b054a4
* Use preprocessor arithmetic instead of C arithmeticeggert1996-01-231-9/+16
| | | | | | | | | | to avoid warnings on some compilers. (HOST_WIDE_INT_MASK): Remove. (MAX_CHAR_TYPE_MASK, MAX_WCHAR_TYPE_MASK): New macros. (yylex): Use them. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11086 138bc75d-0d04-0410-961f-82ee72b054a4
* (HOST_WIDE_INT_MASK): Renamed from LONG_MASK; use HOST_WIDE_INT.eggert1996-01-181-43/+70
| | | | | | | | | | (HOST_WIDE_INT, HOST_BITS_PER_WIDE_INT): New (actually resuscitated) macros. (parse_c_expression, expression_value, parse_escape, left_shift, right_shift, struct constant, exp, parse_number, yylex): Replace `long' with `HOST_WIDE_INT'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11061 138bc75d-0d04-0410-961f-82ee72b054a4
* General code cleanup in the style of 1995-04-01 change.kenner1996-01-161-140/+271
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add prototypes for static functions. Add parentheses suggested by `gcc -Wparentheses'. Use `long' uniformly, instead of long, int, HOST_WIDE_INT mess. (struct constant): Use `signedp' flag (with sign bit) instead of `unsignedp' flag; it's a little more convenient. (HAVE_STDLIB_H, STDC_HEADERS, LONG_MASK, __attribute__, PROTO, VA_START, PRINTF_ALIST, PRINTF_DCL, PRINTF_PROTO, PRINTF_PROTO_1, vfprintf, SIGNED, UNSIGNED): New symbols. <stdlib.h>: Include if HAVE_STDLIB_H. <string.h>: New include. (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT): Remove. (yylex, yyerror, expression_value, parse_number, initialize_random_junk): Now static. (overflow_sum_sign): Renamed from possible_sum_sign, with an extra arg SIGNEDP. (parse_number): Inline strcmp when checking for "0x". (yylex): Keep track of mask needed when decoding wide characters. (parse_escape): New arg RESULT_MASK; use it instead of assuming char width. (yylex, parse_escape, parse_c_expression): Store all host integers as long, not int or HOST_WIDE_INT. (left_shift): No need to do signed left shifts separately. These changes are for the test program (if TEST_EXP_READER): (pedantic, traditional): Allocate storage. (main): Set pedantic, traditional, yydebug depending on args. (is_hor_space, warning, lookup): Change types and implementation to match rest of program. (pedwarn, check_assertion, xmalloc): New functions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11024 138bc75d-0d04-0410-961f-82ee72b054a4
* (yylex, parse_c_expression, main): Likewise.kenner1995-12-291-6/+6
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@10904 138bc75d-0d04-0410-961f-82ee72b054a4
* (parse_number): Improve error message for bogus numbers.kenner1995-12-281-18/+18
| | | | | | | (yylex): Consider `0xe-1' to be a (bogus) number if not traditional. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@10891 138bc75d-0d04-0410-961f-82ee72b054a4
* Update FSF address.kenner1995-06-151-1/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@9959 138bc75d-0d04-0410-961f-82ee72b054a4
* (left_shift): Ignore integer overflow.kenner1995-06-091-11/+5
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@9915 138bc75d-0d04-0410-961f-82ee72b054a4
* (skip_evaluation): New variable.kenner1995-06-091-10/+28
| | | | | | | | | (&&, ||, ?:): Increment it in unevaluated subexpressions. (/, %, integer_overflow): Suppress diagnostics if skip_evaluation != 0. (yyerror): Clear skip_evaluation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@9914 138bc75d-0d04-0410-961f-82ee72b054a4
* (%union): Delete VOIDVAL and SVAL; unused.kenner1995-02-111-3/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@8910 138bc75d-0d04-0410-961f-82ee72b054a4
* (HOST_WIDE_INT, HOST_BITS_PER_WIDE_INT): New macros.kenner1994-09-201-4/+18
| | | | | | | | (expression_value): Now HOST_WIDE_INT. (parse_c_expression): Now returns HOST_WIDE_INT. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@8106 138bc75d-0d04-0410-961f-82ee72b054a4
* Let tm file define MAX_*_TYPE_SIZE if *_TYPE_SIZE depends upon target_flagsian1993-10-061-5/+21
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@5640 138bc75d-0d04-0410-961f-82ee72b054a4
* (parse_escape): Delete case for '^'.rms1993-02-271-7/+0
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@3550 138bc75d-0d04-0410-961f-82ee72b054a4
* (parse_escape): Support \E and \e like cc1:rms1993-02-021-0/+3
| | | | | | | they mean \033, and they generate a warning if pedantic. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@3410 138bc75d-0d04-0410-961f-82ee72b054a4
* (yylex): Make tokstart an unsigned char *.rms1993-01-061-5/+5
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@3115 138bc75d-0d04-0410-961f-82ee72b054a4
* (integer_overflow): Do nothing unless pedantic.rms1992-10-211-1/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@2538 138bc75d-0d04-0410-961f-82ee72b054a4
* (parse_escape): Diagnose '\x' with no digits.rms1992-09-171-5/+10
| | | | | | | Diagnose integer overflow when parsing \x escapes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@2147 138bc75d-0d04-0410-961f-82ee72b054a4
* (parse_number): Warn about '9' in octal constants.rms1992-09-171-13/+17
| | | | | | | Commonize overflow detection for various radices. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@2139 138bc75d-0d04-0410-961f-82ee72b054a4
* (parse_number): Diagnose integer constants that are too large.rms1992-09-141-13/+34
| | | | | | | | Diagnose duplicate `l' and `u' suffixes. Diagnose ` 0x ' and ` 0a '. Warn about integer constants that are so large that they are unsigned. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@2121 138bc75d-0d04-0410-961f-82ee72b054a4
* (exp): Detect signed integer overflow.rms1992-09-131-19/+88
| | | | | | | | | | Replace `(unsigned)' with `(unsigned long)'. When evaluating << and >>, compute the correct answer without shifting by more than HOST_BITS_PER_LONG, or by a negative quantity. (integer_overflow, left_shift, right_shift): New functions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@2118 138bc75d-0d04-0410-961f-82ee72b054a4
* Comment syntax fix.rms1992-09-031-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@2041 138bc75d-0d04-0410-961f-82ee72b054a4
* (NULL_PTR): Use the same definition aswood1992-08-141-1/+11
| | | | | | | rtl.h and tree.h. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@1847 138bc75d-0d04-0410-961f-82ee72b054a4
* entered into RCSkenner1992-07-311-0/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@1731 138bc75d-0d04-0410-961f-82ee72b054a4
* *** empty log message ***rms1992-07-181-0/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@1619 138bc75d-0d04-0410-961f-82ee72b054a4
* Initial revisionmycroft1992-07-061-0/+896
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@1465 138bc75d-0d04-0410-961f-82ee72b054a4