summaryrefslogtreecommitdiff
path: root/gcc/glimits.h
Commit message (Collapse)AuthorAgeFilesLines
* Define TS 18661-1 type width macros in <limits.h> and <stdint.h>.jsm282016-09-091-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TS 18661-1 defines <limits.h> and <stdint.h> macros for widths of standard integer types and the typedefs defined in, or whose limits are defined in, <stdint.h>. (The connection to the main floating-point subject matter of TS 18661-1 is that these are intended to be used with the fromfp functions to convert from floating point to integer types of any width in any rounding direction, though these macros may be of more general use.) This patch implements support for these macros in GCC's <limits.h> and <stdint.h>. To avoid needing to implement fixincludes for system headers where GCC wraps the system libc's <stdint.h> in hosted mode, the test for the <stdint.h> macros uses -ffreestanding (I'll add the macros to glibc's headers separately) - but as usual for new features in these headers, platforms (primarily OpenBSD) that use USER_H to avoid using GCC's headers at all will have failures until the system headers have the feature added or appropriate fixincludes are implemented. The header macros are implemented using appropriate new predefined macros, with the code avoiding defining more such macros than necessary (so one predefined macro suffices for corresponding signed and unsigned types, while no such predefined macros are needed for the exact-width types such as int8_t). Bootstrapped with no regressions on x86_64-pc-linux-gnu. gcc: * doc/cpp.texi (__SCHAR_WIDTH__, __SHRT_WIDTH__, __INT_WIDTH__) (__LONG_WIDTH__, __LONG_LONG_WIDTH__, __PTRDIFF_WIDTH__) (__SIG_ATOMIC_WIDTH__, __SIZE_WIDTH__, __WCHAR_WIDTH__) (__WINT_WIDTH__, __INT_LEAST8_WIDTH__, __INT_LEAST16_WIDTH__) (__INT_LEAST32_WIDTH__, __INT_LEAST64_WIDTH__) (__INT_FAST8_WIDTH__, __INT_FAST16_WIDTH__, __INT_FAST32_WIDTH__) (__INT_FAST64_WIDTH__, __INTPTR_WIDTH__, __INTMAX_WIDTH__): Document. * ginclude/stdint-gcc.h [__STDC_WANT_IEC_60559_BFP_EXT__]: Define width macros from TS 18661-1. * glimits.h [__STDC_WANT_IEC_60559_BFP_EXT__]: Likewise. gcc/c-family: * c-cppbuiltin.c (builtin_define_type_width): New function. (builtin_define_stdint_macros, c_cpp_builtins): Define type width macros. gcc/testsuite: * gcc.dg/limits-width-1.c, gcc.dg/stdint-width-1.c: New tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240048 138bc75d-0d04-0410-961f-82ee72b054a4
* Update copyright years.jakub2016-01-041-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232055 138bc75d-0d04-0410-961f-82ee72b054a4
* Update copyright years.jakub2015-01-051-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219188 138bc75d-0d04-0410-961f-82ee72b054a4
* Update copyright years in gcc/rsandifo2014-01-021-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206289 138bc75d-0d04-0410-961f-82ee72b054a4
* Update copyright years in gcc/rsandifo2013-01-101-2/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195098 138bc75d-0d04-0410-961f-82ee72b054a4
* * ABOUT-GCC-NLS, ChangeLog, ChangeLog-1997, ChangeLog-1998,jsm282009-04-211-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ChangeLog-1999, ChangeLog-2000, ChangeLog-2001, ChangeLog-2002, ChangeLog-2003, ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007, ChangeLog-2008, ChangeLog.dataflow, ChangeLog.lib, ChangeLog.ptr, ChangeLog.tree-ssa, ChangeLog.tuples, FSFChangeLog, FSFChangeLog.10, FSFChangeLog.11, LANGUAGES, ONEWS, acinclude.m4, config/alpha/gnu.h, config/alpha/libgcc-alpha-ldbl.ver, config/alpha/t-osf4, config/alpha/t-vms, config/alpha/va_list.h, config/alpha/x-vms, config/arc/t-arc, config/arm/README-interworking, config/arm/arm-c.c, config/arm/gentune.sh, config/arm/libgcc-bpabi.ver, config/arm/t-arm, config/arm/t-arm-elf, config/arm/t-arm-softfp, config/arm/t-bpabi, config/arm/t-linux, config/arm/t-linux-eabi, config/arm/t-netbsd, config/arm/t-pe, config/arm/t-strongarm-elf, config/arm/t-symbian, config/arm/t-vxworks, config/arm/t-wince-pe, config/avr/t-avr, config/bfin/elf.h, config/bfin/libgcc-bfin.ver, config/bfin/linux.h, config/bfin/t-bfin, config/bfin/t-bfin-elf, config/bfin/t-bfin-linux, config/bfin/t-bfin-uclinux, config/bfin/uclinux.h, config/cris/mulsi3.asm, config/cris/t-cris, config/cris/t-elfmulti, config/crx/t-crx, config/darwin-ppc-ldouble-patch.def, config/darwin-sections.def, config/divmod.c, config/fr30/t-fr30, config/frv/libgcc-frv.ver, config/frv/t-frv, config/frv/t-linux, config/h8300/genmova.sh, config/h8300/t-h8300, config/i386/athlon.md, config/i386/darwin-libgcc.10.4.ver, config/i386/darwin-libgcc.10.5.ver, config/i386/libgcc-glibc.ver, config/i386/mach.h, config/i386/netbsd.h, config/i386/t-crtpc, config/i386/t-cygming, config/i386/t-cygwin, config/i386/t-i386, config/i386/t-linux64, config/i386/t-nwld, config/i386/t-rtems-i386, config/i386/t-sol2-10, config/i386/x-mingw32, config/ia64/div.md, config/ia64/elf.h, config/ia64/ia64.opt, config/ia64/libgcc-glibc.ver, config/ia64/libgcc-ia64.ver, config/ia64/linux.h, config/ia64/sysv4.h, config/ia64/t-hpux, config/ia64/t-ia64, config/iq2000/abi, config/iq2000/lib2extra-funcs.c, config/iq2000/t-iq2000, config/libgcc-glibc.ver, config/m32r/libgcc-glibc.ver, config/m32r/t-linux, config/m32r/t-m32r, config/m68hc11/t-m68hc11, config/m68k/t-floatlib, config/m68k/t-linux, config/m68k/t-mlibs, config/m68k/t-uclinux, config/mcore/t-mcore, config/mcore/t-mcore-pe, config/mips/20kc.md, config/mips/4130.md, config/mips/5400.md, config/mips/5500.md, config/mips/crti.asm, config/mips/crtn.asm, config/mips/irix-crti.asm, config/mips/irix-crtn.asm, config/mips/libgcc-mips16.ver, config/mips/mips-dsp.md, config/mips/mips-dspr2.md, config/mips/mips-fixed.md, config/mips/sb1.md, config/mips/sr71k.md, config/mips/t-elf, config/mips/t-gofast, config/mips/t-iris6, config/mips/t-isa3264, config/mips/t-libgcc-mips16, config/mips/t-linux64, config/mips/t-mips, config/mips/t-r3900, config/mips/t-rtems, config/mips/t-sb1, config/mips/t-sde, config/mips/t-sdemtk, config/mips/t-slibgcc-irix, config/mips/t-sr71k, config/mips/t-st, config/mips/t-vr, config/mips/t-vxworks, config/mmix/t-mmix, config/mn10300/t-linux, config/mn10300/t-mn10300, config/pa/pa32-regs.h, config/pa/t-hpux-shlib, config/pa/t-linux, config/pa/t-linux64, config/pa/t-pa64, config/pdp11/t-pdp11, config/picochip/libgccExtras/clzsi2.asm, config/picochip/t-picochip, config/rs6000/darwin-ldouble-format, config/rs6000/darwin-libgcc.10.4.ver, config/rs6000/darwin-libgcc.10.5.ver, config/rs6000/libgcc-ppc-glibc.ver, config/rs6000/ppc-asm.h, config/rs6000/t-aix43, config/rs6000/t-aix52, config/rs6000/t-darwin, config/rs6000/t-fprules, config/rs6000/t-fprules-fpbit, config/rs6000/t-linux64, config/rs6000/t-lynx, config/rs6000/t-netbsd, config/rs6000/t-ppccomm, config/rs6000/t-ppcendian, config/rs6000/t-ppcgas, config/rs6000/t-rs6000, config/rs6000/t-rtems, config/rs6000/t-spe, config/rs6000/t-vxworks, config/s390/libgcc-glibc.ver, config/score/t-score-elf, config/sh/divcost-analysis, config/sh/libgcc-glibc.ver, config/sh/t-netbsd, config/sh/t-sh, config/sh/t-sh64, config/sh/t-superh, config/sh/t-symbian, config/sparc/libgcc-sparc-glibc.ver, config/sparc/sol2-bi.h, config/sparc/sol2-gas.h, config/sparc/sol2-gld-bi.h, config/sparc/t-elf, config/sparc/t-linux64, config/sparc/t-sol2, config/stormy16/stormy-abi, config/stormy16/t-stormy16, config/t-darwin, config/t-libunwind, config/t-libunwind-elf, config/t-linux, config/t-lynx, config/t-slibgcc-elf-ver, config/t-slibgcc-sld, config/t-sol2, config/t-vxworks, config/udivmod.c, config/udivmodsi4.c, config/v850/t-v850, config/v850/t-v850e, config/xtensa/t-xtensa, diagnostic.def, gdbinit.in, glimits.h, gstab.h, gsyms.h, java/ChangeLog, java/ChangeLog.ptr, java/ChangeLog.tree-ssa, libgcc-std.ver, limitx.h, version.c, xcoff.h: Add copyright and license notices. * config/h8300/genmova.sh: Include copyright and license notices in generated output. * config/h8300/mova.md: Regenerate. * doc/install.texi2html: Include word "Copyright" in copyright notice and use name "Free Software Foundation, Inc.". * ChangeLog, ChangeLog-2000, ChangeLog-2001, ChangeLog-2002, ChangeLog-2003, ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007, ChangeLog-2008: Correct dates. ada: * ChangeLog, ChangeLog.ptr, ChangeLog.tree-ssa: Add copyright and license notices. cp: * ChangeLog, ChangeLog-1993, ChangeLog-1994, ChangeLog-1995, ChangeLog-1996, ChangeLog-1997, ChangeLog-1998, ChangeLog-1999, ChangeLog-2000, ChangeLog-2001, ChangeLog-2002, ChangeLog-2003, ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007, ChangeLog-2008, ChangeLog.ptr, ChangeLog.tree-ssa, NEWS, cfns.gperf: Add copyright and license notices. * cfns.h: Regenerate. * ChangeLog, ChangeLog-2004: Correct dates. fortran: * ChangeLog, ChangeLog-2002, ChangeLog-2003, ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007, ChangeLog-2008, ChangeLog.ptr, config-lang.in, ioparm.def, mathbuiltins.def: Add copyright and license notices. * ChangeLog, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007, ChangeLog-2008: Correct dates. java: * ChangeLog, ChangeLog.ptr, ChangeLog.tree-ssa: Add copyright and license notices. objc: * ChangeLog: Add copyright and license notices. objcp: * ChangeLog: Add copyright and license notices. po: * ChangeLog, EXCLUDES: Add copyright and license notices. testsuite: * ChangeLog, ChangeLog-1993-2007, ChangeLog-2008, ChangeLog.ptr, ChangeLog.tree-ssa, README, README.QMTEST, README.compat, README.gcc, g++.dg/README, g++.dg/compat/break/README, g++.dg/gomp/gomp.exp, g++.old-deja/g++.brendan/README, g++.old-deja/g++.oliva/ChangeLog, g++.old-deja/g++.robertl/README, gcc.c-torture/ChangeLog.0, gcc.c-torture/execute/builtins/builtins.exp, gcc.dg/README, gcc.dg/gomp/gomp.exp, gcc.target/frv/frv.exp, gcc.target/i386/math-torture/math-torture.exp, gcc.target/mips/inter/mips16-inter.exp, gcc.target/mips/mips-nonpic/README, gcc.target/x86_64/abi/README.gcc, gcc.target/xstormy16/xstormy16.exp, gcc.test-framework/README, gfortran.dg/g77/README, gfortran.dg/gomp/gomp.exp, gfortran.fortran-torture/ChangeLog.g95: Add copyright and license notices. * ChangeLog-1993-2007, ChangeLog: Correct dates. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146533 138bc75d-0d04-0410-961f-82ee72b054a4
* * c-common.c (builtin_define_type_max): New.rth2002-06-121-54/+44
| | | | | | | | | | | | | | | | | | | | | (cb_register_builtins): Define __SCHAR_MAX__, __SHRT_MAX__, __INT_MAX__, __LONG_MAX__, __LONG_LONG_MAX__, __CHAR_BIT__. From Joseph S. Myers: * glimits.h: Rewrite to expect the double underscore definitions from the compiler. * config/alpha/unicosmk.h, config/avr/avr.h, config/h8300/h8300.h, config/i386/linux64.h, config/ia64/aix.h, config/ia64/hpux.h, config/ia64/ia64.h, config/m68hc11/m68hc11.h, config/m68hc11/m68hc12.h, config/mips/mips.h, config/mmix/mmix.h, config/mn10200/mn10200.h, config/pa/pa.h, config/rs6000/aix43.h, config/rs6000/aix51.h, config/rs6000/linux64.h, config/s390/linux.h, config/sh/sh.h, config/stormy16/stormy16.h: Don't define any of __SHRT_MAX__, __INT_MAX__, __LONG_MAX__, or __LONG_LONG_MAX__. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54544 138bc75d-0d04-0410-961f-82ee72b054a4
* Remove s390x __LONG_MAX__ special case from glimits.h;uweigand2001-08-141-1/+1
| | | | | | | define __LONG_MAX__ in CPP_PREDEFINES instead. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44879 138bc75d-0d04-0410-961f-82ee72b054a4
* s390x needs 64-bit __LONG_MAX__.uweigand2001-08-101-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44781 138bc75d-0d04-0410-961f-82ee72b054a4
* * glimits.h (_MACH_MACHLIMITS_H_): Delete.ro2001-07-261-5/+0
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44408 138bc75d-0d04-0410-961f-82ee72b054a4
* * glimits.h (__SHRT_MAX__): New.rth2001-07-061-6/+9
| | | | | | | | (SHRT_MIN, USHRT_MAX): Define in terms of SHRT_MAX. (SHRT_MAX): Define in terms of __SHRT_MAX__. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43825 138bc75d-0d04-0410-961f-82ee72b054a4
* 2001-06-26 Vladimir Makarov <vmakarov@toke.toronto.redhat.com>vmakarov2001-06-261-4/+8
| | | | | | | | * glimits.h (USHRT_MAX): Use unsigned suffix if int can not hold it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43584 138bc75d-0d04-0410-961f-82ee72b054a4
* * config/rs6000/aix43.h (CPP_SPEC): Define __LONG_MAX__ correctlygeoffk2000-07-211-1/+1
| | | | | | | | in 64-bit mode. * glimits.h: Don't do #if defined for ARCH_PPC. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35165 138bc75d-0d04-0410-961f-82ee72b054a4
* * glimits.h (LLONG_MIN, LLONG_MAX, ULLONG_MAX): Define for C99.law2000-07-171-2/+15
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35088 138bc75d-0d04-0410-961f-82ee72b054a4
* * rs6000.c (processor_target_table): Add power3 as alias for 630.dje2000-01-071-1/+1
| | | | | | | | | | | | | | | | | | | * aix43.h: Revert Aug 2 change. (HAS_INIT_SECTION): Define, not visible yet. (LD_INIT_SWITCH): Define, not visible yet. * t-aix43 (MULTILIB_OPTIONS): Revert Aug 2 change. * glimits.h (__LONG_MAX__): Recognize 64-bit AIX too. * collect2.c (main): Expand ld2 size further. (export_object_lst): Cast assignment to avoid warning. (main, LD_INIT_SWITCH): Add AIX 4.2+ -binitfini support. (scan_prog_file, COFF): Do not collect initialization or finalization functions generated for entire shared object if init/fini support present. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31275 138bc75d-0d04-0410-961f-82ee72b054a4
* * config/sparc/xm-sp64.h: Avoid using __sparc_v9__ when testingjakub1999-12-141-1/+1
| | | | | | | | | | | | for sparc64. * config/sparc/sparc.h: Likewise. * config/sparc/xm-sysv4-64.h: Likewise. * config/float-sparc.h: Likewise. * glimits.h: Likewise. * longlong.h: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30917 138bc75d-0d04-0410-961f-82ee72b054a4
* * glimits.h (__LONG_MAX__): Recognize __sparcv9 too.davem1998-09-101-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@22384 138bc75d-0d04-0410-961f-82ee72b054a4
* * glimits.h (SHRT_MIN): Define in a way suitable for 16 bit hosts.amylaar1997-11-121-1/+2
| | | | | | | | | * c-lex.c (whitespace_cr, skip_white_space_on_line): New functions. (skip_white_space): Use whitespace_cr. (check_newline): Handle whitespace more consistently. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@16433 138bc75d-0d04-0410-961f-82ee72b054a4
* * glimits.h (LONG_MAX): Handle sparc64.dje1997-09-251-4/+4
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@15702 138bc75d-0d04-0410-961f-82ee72b054a4
* (__LONG_MAX__): on Alpha, use 64 bit value.kenner1996-03-121-0/+4
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11521 138bc75d-0d04-0410-961f-82ee72b054a4
* (UINT_MAX, ULONG_MAX, ULONG_LONG_MAX): redefine in a simpler way.dje1993-09-291-5/+3
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@5532 138bc75d-0d04-0410-961f-82ee72b054a4
* (INT_MAX, LONG_MAX, LONG_LONG_MAX): Delete parens.rms1993-09-281-6/+8
| | | | | | | | (__glimits__evconcat__, __glimits__concat__): New macros. (UINT_MAX, ULONG_MAX, ULONG_LONG_MAX): Use them. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@5518 138bc75d-0d04-0410-961f-82ee72b054a4
* (__INT_MAX__, __LONG_MAX__, __LONG_LONG_MAX__): New macros.dje1993-09-021-6/+15
| | | | | | | (INT_MAX, LONG_MAX, LONG_LONG_MAX): Use them. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@5252 138bc75d-0d04-0410-961f-82ee72b054a4
* Don't override system definition of MB_LEN_MAXian1993-07-071-2/+3
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@4876 138bc75d-0d04-0410-961f-82ee72b054a4
* entered into RCSmycroft1992-05-271-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@1094 138bc75d-0d04-0410-961f-82ee72b054a4
* *** empty log message ***rms1992-04-271-3/+3
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@845 138bc75d-0d04-0410-961f-82ee72b054a4
* *** empty log message ***rms1992-04-211-0/+12
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@811 138bc75d-0d04-0410-961f-82ee72b054a4
* *** empty log message ***wood1992-03-051-3/+3
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@394 138bc75d-0d04-0410-961f-82ee72b054a4
* *** empty log message ***rms1991-12-181-0/+10
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122 138bc75d-0d04-0410-961f-82ee72b054a4
* Initial revisionmeissner1991-12-051-0/+61
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101 138bc75d-0d04-0410-961f-82ee72b054a4