summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* configure: raise minimum autoconf requirement to 2.70HEADmasterAlan Coopersmith2023-02-161-1/+1
| | | | | | | | Needed for builds on NetBSD to work correctly, since it depends on AC_USE_SYSTEM_EXTENSIONS defining _OPENBSD_SOURCE to expose the prototype for reallocarray() in the system headers. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Avoid depending on xprotoFabian Vogt2023-02-015-21/+27
| | | | | | | | makedepend is rather early in the distro bootstrap chain, so it shouldn't pull in anything it doesn't really need. xproto is only pulled in for two macros which we can just as easily provide ourselves.
* Make more things static that aren't needed in more than one fileAlan Coopersmith2023-01-013-33/+36
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Call strrchr() instead of hand coding a custom versionAlan Coopersmith2023-01-013-9/+6
| | | | | | Also correct comments on hand-coded custom strcmp() replacements Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Cache filename after realpath() processingAlan Coopersmith2023-01-013-9/+21
| | | | | | | Avoid having to make an additional system call for every time we compare full path names. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Make malloc error checking/reporting more consistentAlan Coopersmith2023-01-013-5/+33
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* cppsetup: use C99 struct initializationAlan Coopersmith2023-01-011-11/+12
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Stop casting _parse_data pointers through (char *) and backAlan Coopersmith2023-01-012-4/+4
| | | | | | | | | | | | | | Eliminates clang warnings: cppsetup.c:41:30: warning: cast from 'char *' to 'struct _parse_data *' increases required alignment from 1 to 8 [-Wcast-align] struct _parse_data *pd = (struct _parse_data *) ip->data; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cppsetup.c:69:30: warning: cast from 'char *' to 'struct _parse_data *' increases required alignment from 1 to 8 [-Wcast-align] struct _parse_data *pd = (struct _parse_data *) ip->data; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Handle some implicit conversion warnings from clangAlan Coopersmith2023-01-016-18/+18
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Use reallocarray() on systems that provide itAlan Coopersmith2023-01-015-14/+26
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* quoteColons: Remove redundant initialization of tmpAlan Coopersmith2023-01-011-1/+1
| | | | | | | | | | | | | As warned by cppcheck: pr.c:83:9: style: Redundant initialization for 'tmp'. The initialized value is overwritten before it is read. [redundantInitialization] tmp = input; ^ pr.c:74:21: note: tmp is initialized const char *tmp = input; ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* find_includes: rename variables to avoid shadowing globalAlan Coopersmith2023-01-011-4/+4
| | | | | | | | | | | | | | | Clears gcc warning: parse.c: In function ‘find_includes’: parse.c:620:29: warning: declaration of ‘inclistp’ shadows a global declaration [-Wshadow] struct inclist *inclistp = inclistnext; ^~~~~~~~ In file included from parse.c:27:0: def.h:171:26: note: shadowed declaration is here extern struct inclist *inclistp; ^~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Store predefined -D values in const char fieldsAlan Coopersmith2023-01-012-9/+11
| | | | | | Clears up 28 -Wdiscarded-qualifiers warnings from gcc Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Variable scope reduction as suggested by cppcheckAlan Coopersmith2023-01-014-28/+33
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Remove register keyword from variable declarationsAlan Coopersmith2022-12-123-22/+22
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Reformat code into X.Org standard coding styleAlan Coopersmith2022-12-129-2180/+2175
| | | | | | Make indentation and formatting much more consistent across this project Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* makedepend 1.0.8makedepend-1.0.8Alan Coopersmith2022-12-121-1/+1
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Bug #2: fix regression introduced by fix for bug #1Alan Coopersmith2022-12-051-52/+49
| | | | | | | | | | | | Refactor code to find the full file path before comparing against existing items in the list so that we stop adding duplicate entries for all the files in the system include path and with larger amounts of code hitting the MAXFILES limit. Fixes: 3dc64b0 ("Add test case for bug #1 + proposed fix.") Closes: #2 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* man page: add line breaks in Synopsis sectionAlan Coopersmith2022-12-051-4/+9
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* makedepend 1.0.7makedepend-1.0.7Alan Coopersmith2022-10-281-2/+2
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Use AC_CONFIG_FILES to replace the deprecated AC_OUTPUT with parametersAlan Coopersmith2022-06-181-1/+2
| | | | | | | configure.ac:32: warning: AC_OUTPUT should be used without arguments. configure.ac:32: You should run autoupdate. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Add test case for bug #1 + proposed fix.Thibault DUPONCHELLE2022-04-106-2/+78
| | | | Fixes: https://gitlab.freedesktop.org/xorg/util/makedepend/issues/1
* gitlab CI: stop requiring Signed-off-by in commitsAlan Coopersmith2022-04-101-1/+1
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Close fd for reading old Makefile when done, instead of leaking itAlan Coopersmith2022-04-101-0/+1
| | | | | | | | | | | | Found by Oracle Parfait: Error: File Leak File Leak [file-ptr-leak]: Leaked File fdin at line 799 of main.c in function 'redirect'. fdin initialized at line 769 with fopen Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* gitlab CI: add a basic build testAlan Coopersmith2022-01-151-0/+98
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Build xz tarballs instead of bzip2Alan Coopersmith2022-01-151-1/+1
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* makedepend 1.0.6makedepend-1.0.6Alan Coopersmith2019-03-162-1/+3
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Update configure.ac bug URL for gitlab migrationAlan Coopersmith2018-12-071-1/+1
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Update README for gitlab migrationAlan Coopersmith2018-11-193-26/+19
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Simplify writing of output lines to MakefileAlan Coopersmith2018-05-051-5/+2
| | | | | | | | | | | | | | Instead of writing everything to a temporary buffer, and then using fwrite() to have it fputc() one character at a time into the stdio buffer, just use fprintf() directly to save a copy and write in larger blocks. Testing on Solaris on makedepend's own source files showed a reduction in memcpy's from 4037 to 3108, and in _dowrite calls in stdio from 1173 to 168, but no change in actual write calls from stdio's buffer to the file. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Remove unused variable whitespaceAlan Coopersmith2018-05-051-3/+0
| | | | | | | | | | | | | Use of it was removed in commit 275c17136006f9d, but we kept setting it anyway. Resolves gcc 7.3 warning: main.c: In function ‘getnextline’: main.c:587:10: warning: variable ‘whitespace’ set but not used [-Wunused-but-set-variable] boolean whitespace = FALSE; ^~~~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Fix bad indentation in ifparser.cAlan Coopersmith2018-05-051-3/+3
| | | | | | | | | | | | ifparser.c: In function ‘parse_product’: ifparser.c:300:5: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation] else ^~~~ ifparser.c:302:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’ break; ^~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Quote colons in filenames/pathsAntonio Larrosa2018-05-051-4/+44
| | | | | | | | | Makefile doesn't like colons in filenames/paths so they must be quoted in the output. Otherwise makedepend doesn't work with full paths that contain a colon. V2: Use quoted filename when measuring name length Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Bumped -I flag limit in makedepend from 64 to 512.David Boyce2018-03-251-1/+1
| | | | | | | | Clearly a limit of 64 -I flags is too low (we hit it); it might be a good style recommendation but shouldn't be a hard limit. 512 is a fairly random replacement value. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* missing bounds check in makedepend for file argumentsDirk2018-03-241-0/+3
| | | | | | | | | | | | When assigning source code files from the command line to the fp pointer, no bounds check is done and if more than MAXFILES file names are specified on the command line, memory will be overridden out of bounds. https://bugs.freedesktop.org/show_bug.cgi?id=94099 Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Tested-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* autogen: add default patch prefixMihail Konev2017-01-261-0/+3
| | | | Signed-off-by: Mihail Konev <k.mvc@ya.ru>
* autogen.sh: use quoted string variablesEmil Velikov2017-01-261-5/+4
| | | | | | | | | Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent fall-outs, when they contain space. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* autogen.sh: use exec instead of waiting for configure to finishPeter Hutterer2017-01-261-1/+1
| | | | | | | Syncs the invocation of configure with the one from the server. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* Use do { ... } while(0) idiom to make debug() macro saferAlan Coopersmith2016-03-271-2/+2
| | | | | | | Cleans up several -Wempty-body warnings from gcc 5.3 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
* Constify a pair of local string pointersAlan Coopersmith2013-08-021-2/+2
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* makedepend 1.0.5makedepend-1.0.5Alan Coopersmith2013-07-221-1/+1
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Don't crash if an option's argument is missingJulien Cristau2013-07-021-0/+16
| | | | | | | | | | Avoid dereferencing argv[argc]. See http://www.forallsecure.com/bug-reports/011f1a55f79a5501b36008d6ee0d40e8b6644569/ Reported-by: Alexandre Rebert <alexandre@cmu.edu> Signed-off-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Assume signal handlers return void, as C89 requiresAlan Coopersmith2013-02-232-4/+1
| | | | | | Drops use of autoconf's obsolete AC_TYPE_SIGNAL Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Bug 56091 - Unsafe use of strcpy() in makedependAlan Coopersmith2013-02-151-1/+1
| | | | | | | | Use memmove for potentially overlapping copies. Reported-by: Laurence Jupp <laurence@narya.org> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
* Store len in a size_t instead of an int in redirect()Alan Coopersmith2013-02-121-1/+1
| | | | | | | | | | | | | | | Fixes clang warnings about converting back & forth: main.c:761:8: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32] len = strlen(line); ~ ^~~~~~~~~~~~ main.c:763:41: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] if (*buf == '#' && strncmp(line, buf, len) == 0) ~~~~~~~ ^~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Mark fatalerr & catch as _X_NORETURNbaserock/morphAlan Coopersmith2013-01-203-3/+3
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Replace deprecated Automake INCLUDES variable with AM_CPPFLAGSAlan Coopersmith2013-01-191-2/+1
| | | | | | | | | | | | | | Excerpt https://lists.gnu.org/archive/html/automake/2012-12/msg00038.html - Support for the long-deprecated INCLUDES variable will be removed altogether in Automake 1.14. The AM_CPPFLAGS variable should be used instead. This variable was deprecated in Automake releases prior to 1.10, which is the current minimum level required to build X. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org>
* Bug 52099 - makedepend rename fails on CIFS mounted sharesGlenn Burkhardt2013-01-161-11/+13
| | | | | | | | | Patch v1: https://bugs.freedesktop.org/attachment.cgi?id=64218 v2: modified by Alan Coopersmith to restore Makefile to original name if contents cannot be read, instead of leaving it moved to .bak name. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* autogen.sh: Implement GNOME Build APIColin Walters2013-01-161-1/+3
| | | | | | http://people.gnome.org/~walters/docs/build-api.txt Signed-off-by: Adam Jackson <ajax@redhat.com>
* configure: Drop AM_MAINTAINER_MODEAdam Jackson2013-01-161-1/+0
| | | | Signed-off-by: Adam Jackson <ajax@redhat.com>