summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-02-04makedepend 1.0.9HEADmakedepend-1.0.9masterAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-10-11ifparser.c: divide-by-zero fixPetre Rodan
2023-02-16configure: raise minimum autoconf requirement to 2.70Alan Coopersmith
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>
2023-02-01Avoid depending on xprotoFabian Vogt
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.
2023-01-01Make more things static that aren't needed in more than one fileAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-01Call strrchr() instead of hand coding a custom versionAlan Coopersmith
Also correct comments on hand-coded custom strcmp() replacements Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-01Cache filename after realpath() processingAlan Coopersmith
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>
2023-01-01Make malloc error checking/reporting more consistentAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-01cppsetup: use C99 struct initializationAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-01Stop casting _parse_data pointers through (char *) and backAlan Coopersmith
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>
2023-01-01Handle some implicit conversion warnings from clangAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-01Use reallocarray() on systems that provide itAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-01quoteColons: Remove redundant initialization of tmpAlan Coopersmith
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>
2023-01-01find_includes: rename variables to avoid shadowing globalAlan Coopersmith
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>
2023-01-01Store predefined -D values in const char fieldsAlan Coopersmith
Clears up 28 -Wdiscarded-qualifiers warnings from gcc Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-01-01Variable scope reduction as suggested by cppcheckAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-12Remove register keyword from variable declarationsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-12Reformat code into X.Org standard coding styleAlan Coopersmith
Make indentation and formatting much more consistent across this project Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-12makedepend 1.0.8makedepend-1.0.8Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-05Bug #2: fix regression introduced by fix for bug #1Alan Coopersmith
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>
2022-12-05man page: add line breaks in Synopsis sectionAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-10-28makedepend 1.0.7makedepend-1.0.7Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-06-18Use AC_CONFIG_FILES to replace the deprecated AC_OUTPUT with parametersAlan Coopersmith
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>
2022-04-10Add test case for bug #1 + proposed fix.Thibault DUPONCHELLE
Fixes: https://gitlab.freedesktop.org/xorg/util/makedepend/issues/1
2022-04-10gitlab CI: stop requiring Signed-off-by in commitsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-04-10Close fd for reading old Makefile when done, instead of leaking itAlan Coopersmith
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>
2022-01-15gitlab CI: add a basic build testAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-01-15Build xz tarballs instead of bzip2Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-03-16makedepend 1.0.6makedepend-1.0.6Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-12-07Update configure.ac bug URL for gitlab migrationAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-19Update README for gitlab migrationAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-05-05Simplify writing of output lines to MakefileAlan Coopersmith
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>
2018-05-05Remove unused variable whitespaceAlan Coopersmith
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>
2018-05-05Fix bad indentation in ifparser.cAlan Coopersmith
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>
2018-05-05Quote colons in filenames/pathsAntonio Larrosa
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>
2018-03-25Bumped -I flag limit in makedepend from 64 to 512.David Boyce
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>
2018-03-24missing bounds check in makedepend for file argumentsDirk
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>
2017-01-26autogen: add default patch prefixMihail Konev
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-26autogen.sh: use quoted string variablesEmil Velikov
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>
2017-01-26autogen.sh: use exec instead of waiting for configure to finishPeter Hutterer
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>
2016-03-27Use do { ... } while(0) idiom to make debug() macro saferAlan Coopersmith
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>
2013-08-02Constify a pair of local string pointersAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-22makedepend 1.0.5makedepend-1.0.5Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-02Don't crash if an option's argument is missingJulien Cristau
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>
2013-02-23Assume signal handlers return void, as C89 requiresAlan Coopersmith
Drops use of autoconf's obsolete AC_TYPE_SIGNAL Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-02-15Bug 56091 - Unsafe use of strcpy() in makedependAlan Coopersmith
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>
2013-02-12Store len in a size_t instead of an int in redirect()Alan Coopersmith
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>
2013-01-20Mark fatalerr & catch as _X_NORETURNAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-19Replace deprecated Automake INCLUDES variable with AM_CPPFLAGSAlan Coopersmith
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>
2013-01-16Bug 52099 - makedepend rename fails on CIFS mounted sharesGlenn Burkhardt
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>