aboutsummaryrefslogtreecommitdiff
path: root/fixincludes/fixincl.c
AgeCommit message (Collapse)AuthorFilesLines
2021-11-24fixincludes: don't abort() on access failure [PR103306]Xi Ruoyao1-3/+12
Some distro may ship dangling symlinks in include directories, triggers the access failure. Skip it and continue to next header instead of being to panic. Restore to old behavior before r12-5234 but without resurrecting the problematic getcwd() call, by using the environment variable "INPUT" exported by fixinc.sh. Tested on x86_64-linux-gnu, with a dangling symlink intentionally injected into /usr/include. fixincludes/ PR bootstrap/103306 * fixincl.c (process): Don't call abort().
2021-11-14fixincludes: simplify handling for access() failure [PR21283, PR80047]Xi Ruoyao1-5/+4
POSIX says: On some implementations, if buf is a null pointer, getcwd() may obtain size bytes of memory using malloc(). In this case, the pointer returned by getcwd() may be used as the argument in a subsequent call to free(). Invoking getcwd() with buf as a null pointer is not recommended in conforming applications. This produces an error building GCC with --enable-werror-always: ../../../fixincludes/fixincl.c: In function ‘process’: ../../../fixincludes/fixincl.c:1356:7: error: argument 1 is null but the corresponding size argument 2 value is 4096 [-Werror=nonnull] It's suggested by POSIX to call getcwd() with progressively larger buffers until it does not give an [ERANGE] error. However, it's highly unlikely that this error-handling route is ever used. So we can simplify it instead of writting too much code. We give up to use getcwd(), because `make` will output a `Leaving directory ...` message containing the path to cwd when we call abort(). fixincludes/ChangeLog: PR other/21823 PR bootstrap/80047 * fixincl.c (process): Simplify the handling for highly unlikely access() failure, to avoid using non-standard extensions.
2016-09-30check.tpl: Convert line endings to unix on test outputsTadek Kijkowski1-7/+60
2016-09-30 Tadek Kijkowski <tkijkowski@gmail.com> * check.tpl: Convert line endings to unix on test outputs * fixfixes.c: Fixed passing file name to apply_fix when SEPARATE_FIX_PROC is defined * fixincl.c: Use system_with_shell, fixes for MinGW and DJGPP * fixlib.c, fixlib.h: Added system_with_shell and fix_path_separators From-SVN: r240664
2015-01-31* fixincl.c (fix_applies) <case TT_CKSUM:>: Change C++ style comments.Uros Bizjak1-1/+1
From-SVN: r220304
2015-01-28checksums and test-textBruce Korb1-46/+113
* fixincl.tpl: add a check sum acceptance test * fixlib.h: enumerate it * fixincl.c: handle it * README: document it and document the handling of test_text From-SVN: r220215
2013-01-04Update Copyright years for files modified in 2011 and/or 2012.Jakub Jelinek1-1/+1
From-SVN: r194903
2012-10-29Omit testing wrap and replacement fixes during testing.Bruce Korb1-16/+11
This exposes a missing result and tests a test that got hidden before. From-SVN: r192952
2012-04-24fixincl.c (fix_with_system): Add missing specifier.Tristan Gingold1-1/+1
2012-04-24 Tristan Gingold <gingold@adacore.com> * fixincl.c (fix_with_system): Add missing specifier. * configure.ac: Default to twoprocess on vms. * configure: Regenerate. From-SVN: r186759
2009-04-09Licensing changes to GPLv3 resp. GPLv3 with GCC Runtime Exception.Jakub Jelinek1-6/+6
From-SVN: r145841
2008-04-26fixincl.c (fix_with_system): Fixed typo.Kai Tietz1-1/+1
2008-04-25 Kai Tietz <kai.tietz@onevision.com> * fixincl.c (fix_with_system): Fixed typo. From-SVN: r134684
2008-04-25fixincl.c (fix_with_system): Cast pointer difference to long.Kai Tietz1-1/+1
2008-04-25 Kai Tietz <kai.tietz@onvision.com> * fixincl.c (fix_with_system): Cast pointer difference to long. * fixlib.c (make_raw_shell_str): Cast compare to avoid sign warning. From-SVN: r134679
2008-02-25re PR other/32948 (five warnings and a patch)Ben Elliston1-3/+0
fixincludes/ PR other/32948 * fixincl.c (fix_applies): Remove unused variable `name_len'. gcc/ PR other/32948 * c-decl.c (grokdeclarator): Remove unused local variables `typedef_type' and `type_as_written'. * bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges): Remove unused local variable `has_hot_blocks'. (fix_crossing_conditional_branches): Remove unused local variable `prev_bb'. From-SVN: r132618
2007-01-06Set SKIP_TEST flag if we are not to run a test.Bruce Korb1-2/+7
Co-Authored-By: Daniel Franke <franke.daniel@gmail.com> From-SVN: r120529
2007-01-06Use fnmatch for name matching.Bruce Korb1-99/+29
Co-Authored-By: Daniel Franke <franke.daniel@gmail.com> From-SVN: r120528
2005-11-25Check the last byte for '\n'Bruce Korb1-1/+4
From-SVN: r107492
2005-08-15All files: Update with new FSF address.Kelley Cook1-2/+2
2005-08-14 Kelley Cook <kcook@gcc.gnu.org> * All files: Update with new FSF address. From-SVN: r103096
2005-05-22re PR bootstrap/21683 (build failure on i386-mingw (sys/wait.h header))Danny Smith1-0/+2
PR target/21683 * fixincl.c: Don't include <sys/wait.h> if SEPARATE_FIX_PROC. From-SVN: r100066
2005-05-15fixlib.c (load_file_data): Use XRESIZVEC in lieu of xrealloc.Gabriel Dos Reis1-4/+5
* fixlib.c (load_file_data): Use XRESIZVEC in lieu of xrealloc. * server.c (load_data): Likewise. (run_shell): Use XCNEW (char) in lieu of xcalloc (1, 1). * fixincl.c: #include <sys/wait.h> (run_compiles): Use XCNEWVEC instead of xcalloc. (fix_with_system, start_fixer): Use XNEWVEC instead of xmalloc. * fixfixes.c (FIX_PROC_HEAD, main): Likewise. From-SVN: r99740
2004-11-17remove confusing and unnecessary backslashesBruce Korb1-2/+2
From-SVN: r90790
2004-11-17correct misuse of variablesBruce Korb1-33/+35
From-SVN: r90789
2004-10-27re PR other/17991 (Two-process fixincludes broken: pz_mn_name_pat undefined)Paolo Bonzini1-1/+1
2004-10-27 Paolo Bonzini <bonzini@gnu.org> PR other/17991 * configure.ac: Fix typo. * configure: Regenerate. * fixincl.c (fix_with_system): tSCC is not a pointer. Fix. From-SVN: r89680
2004-10-20re PR bootstrap/17832 (Bootstrap broken by fixincludes failures)Aaron W. LaFramboise1-9/+6
PR bootstrap/17832 * fixincl.c (SIGCHLD): Remove definition. (initialize): Remove SIGIOT and SIGPIPE checks. (create_file): Fix mkdir() for Win32. (internal_fix): Use dup2() instead of fcntl(). * fixlib.h (SIGQUIT): Define if undefined. (SIGIOT): Same. (SIGPIPE): Same. (SIGALRM): Same. (SIGKILL): Same. * procopen.c (chain_open): Use dup2() instead of fcntl(). From-SVN: r89326
2004-10-15re PR other/17991 (Two-process fixincludes broken: pz_mn_name_pat undefined)Paolo Bonzini1-51/+37
2004-08-14 Paolo Bonzini <bonzini@gnu.org> PR other/17991 * Makefile.in (ALLOBJ, TESTOBJ, FIXOBJ): Add fixopts.o. Update copyright year. * fixfixes.c (main): Call initialize_opts from fixopts.c. * fixincl.c (initialize): Call initialize_opts from fixopts.c, do not include code for parsing options (environment vars). (fix_with_system): Use a search path for applyfix, so that you can run the test suite with two-process fixincludes. * fixopts.c: New file. * configure.ac: Add --enable-twoprocess. Export ac_exeext to config.h. Default to --enable-twoprocess for MinGW32. * config.h.in: Regenerate. * configure: Regenerate. From-SVN: r89087
2004-08-31Made fixincludes a toplevel build module.Paolo Bonzini1-0/+1435
toplevel: 2004-08-31 Paolo Bonzini <bonzini@gnu.org> * Makefile.def (build_modules): Add fixincludes. (dependencies): Make gcc depend on fixincludes. * configure.in (build_tools): Add fixincludes. (build_configdirs): Always include build_libs. * Makefile.in: Regenerate. * configure: Regenerate. contrib: 2004-08-04 Paolo Bonzini <bonzini@gnu.org> * gcc_update: Add fixincludes. fixincludes: 2004-08-31 Paolo Bonzini <bonzini@gnu.org> * .cvsignore: New. * Makefile.in: From gcc/fixinc/Makefile.in, making it fully autoconfiscated. * configure.ac: New. * config.h.in: Generate. * configure: Generate. * aclocal.m4: New. * fixlib.h: Remove inclusions of gcc files. * system.h: New. Other files copied from gcc/fixinc. gcc: 2004-08-31 Paolo Bonzini <bonzini@gnu.org> * Makefile.in (build_subdir): New substitution. (fixinc.sh): Simplify heavily since fixincludes is already built. (stmp-fixinc): Depend on specs.ready. (install-mkheaders): Use new location of fixincludes. (clean): Do not descend into fixinc. (FORBUILD): Replace with ../$(build_subdir). * configure.ac (build_subdir): Substitute. (FORBUILD): Do not set. (all_outputs): Remove fixinc/Makefile. (default commands): Do not create links in fixinc. * mkfixinc.sh: New, from fixinc/mkfixinc.sh without the fixincludes configuration steps and substituting @FIXINCL@ in fixinc.in. * fixinc.in: New, from fixinc/fixincl.sh. * fixinc/*: Removed. From-SVN: r86824