Automake/Libtool warning fix/suppression This changeset cleans up all of the warnings that our autogen.sh spits out. At least on my system with automake 1.15, and libtool 2.4.6. A possibly controversial change here (read: ugly as hell) is that I've symlinked a couple of files from `src' into `lib-src'. The lib-src/Makefile.am referenced regex.c, regex.h, and alloca.c in 'src'. That caused automake to freak out and warn that we were using source files in subdirectories which would become incompatible in the future. Automake does have a "subdir-objects" option for this type of thing, but it causes problems elsewhere in our build chain. The symlink "fix" is quick, dirty, and easy, however I'm happy to have it reverted if a neater solution can be found. * m4/sxe-libtool.m4 (_SXE_CHECK_LT2): Pull in `_LT_COMPILER_PIC' to fix a swag of warnings about macros being expanded before being required. * lib-src/Makefile.am (REGEX_C, ALLOCA_C): Point to files in the current directory which are symlinks to the originals in `src'. This prevents a scary warning from automake about files in subdirectories and future incompatibities. Automake does have a "subdir-objects" option, but because we have a specialised build that causes more problems than it fixes. * configure.ac (AM_INIT_AUTOMAKE): Use `-Wno-override' and `-Wno-portability' to suppress harmless and irrelevant, at least to us, warnings. Signed-off-by: Steve Youngs <steve@sxemacs.org>
Bug fix: 161 etags munges relative filenames (any path containing "..") in TAGS files Two bugs fixed here. One was Coverity induced, but another one, the strcpy -> memmove change is a real issue regarding copying in overlapping memory. * lib-src/etags.c (relative_filename): Correct off-by-1 error in counting down remaining bytes. * lib-src/etags.c (absoulte_filename): Change strcpy to memmove since this is a guaranteed overlapping memory copy, and strcpy is not guaranteed by POSIX to handle it properly. http://pubs.opengroup.org/onlinepubs/9699919799/functions/stpcpy.html "If copying takes place between objects that overlap, the behavior is undefined." Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
Fix usage of xstrncpy * lib-src/fakemail.c (make_file_preface): make sure the len argument to xstrcpy is always the available buffer len * lib-src/ootags.c: Only define etags_strchr and etags_strrchr if configure did not detect the right ones. * lib-src/ootags.c (consider_token): Ditto * lib-src/ootags.c (C_entries): Ditto * lib-src/ootags.c (Pascal_functions): Ditto * lib-src/ootags.c (Prolog_functions): Ditto * lib-src/ootags.c (Erlang_functions): Ditto * lib-src/ootags.c (savenstr): Ditto. * lib-src/ootags.c (substitute): Properly account for remaining buffer available. * lib-src/gnuserv.c (handle_ipc_request): use buffer size instead of message length for copy. also no need to \0 terminate with xstrncpy * lib-src/pop.c (pop_stat): Use xstrncpy here. * src/dumper.c (pdump_load): No need for \0 termination here. * src/emacs.c (make_docfile): use remaining size of buffer, not len of source.. * src/sysdep.h (x__dirname): Use just len. xstrncpy will stop early. * src/sysdep.h (xdirname): Oops, need +1 for the \0 terminator. * src/ui/redisplay.c (add_bufbyte_string_runes): Account for the \0 terminator. Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
Fix etags xstrncpy usage, and some other niceties * lib-src/etags.c: Make etags_strchr, etags_strrchr, etags_strcasecmp, etags_strncasecmp only be defined if they were not detected by configure. * lib-src/etags.c(consider_token): Adjust strncpy and string size. * lib-src/etags.c(C_entries): Ditto. * lib-src/etags.c(Pascal_functions): Ditto. * lib-src/etags.c(HTML_labels): Ditto. * lib-src/etags.c(Prolog_functions): Ditto. * lib-src/etags.c(Erlang_functions): Ditto. * lib-src/etags.c(substitute): Properly account for buffer size to supply to xstrncpy. * lib-src/etags.c(readline_internal): Only reallocate after size is enough. Also correct the buffer available supplied to xstrncpy. * lib-src/etags.c(savenstr): correct the size of buffer parameter supplied to xstrncpy. * lib-src/etags.c(linebuffer_setlen): Only reallocate after size is enough. Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
Fix build for branches without tags * autogen.sh (emacs_is_beta): Correct the text for branches without the release tags... * lib-src/make-dump-id.c: Include the config.h from the proper directory. This was not an issue for a long time, since there was always a tag when under git control. make-dump-id was only compiled then. Now in autogen.sh we will always make sure there is a tree version, so this will no longer be an issue again. Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
xstrncpy saga * lib-src/fakemail.c (make_file_preface): Use xstrncpy instead of strncpy * lib-src/fakemail.c (read_header): ditto. * lib-src/fakemail.c (main): ditto. * lib-src/gnuclient.c (main): ditto. * lib-src/gnuserv.c (handle_ipc_request): ditto. * lib-src/movemail.c (concat): ditto. * lib-src/movemail.c (pop_retr): ditto. * lib-src/movemail.c (pop_retr): ditto. * lib-src/movemail.c (pop_search_top): ditto. * lib-src/movemail.c (pop_search_top): ditto. * lib-src/ootags.c (consider_token): ditto. * lib-src/ootags.c (C_entries): ditto. * lib-src/ootags.c (Pascal_functions): ditto. * lib-src/ootags.c (Prolog_functions): ditto. * lib-src/ootags.c (Erlang_functions): ditto. * lib-src/ootags.c (substitute): ditto. * lib-src/ootags.c (savenstr): ditto. * lib-src/pop.c (pop_stat): ditto. * lib-src/pop.c (pop_list): ditto. * lib-src/pop.c (pop_multi_first): ditto. * lib-src/pop.c (pop_last): ditto. * lib-src/pop.c (getok): ditto. * lib-src/yow.c (main): ditto. Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
Don't use strncpy, instead use *dest='\0' followed by strncat (with len-1) * lib-src/etags.c (write_classname): use xstrncpy instead of strncpy * lib-src/etags.c (consider_token): ditto. * lib-src/etags.c (C_entries): ditto. * lib-src/etags.c (Pascal_functions): ditto. * lib-src/etags.c (HTML_lables): ditto. * lib-src/etags.c (Prolog_functions): ditto. * lib-src/etags.c (Erlang_functions): ditto. * lib-src/etags.c (substitute): ditto. * lib-src/etags.c (readline_internal): ditto. * lib-src/etags.c (savenstr): ditto. * lib-src/etags.c (concat): ditto. Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
Coverity: CID 610-DEAD CODE 611-UNUSED VALUE * lib-src/etags.c (process_file_name): compr was not being used before anyway so just remove the assignment from the if statement. * lib-src/etags.c (process_file_name): only make compressed_value NULL if it was previously not null. But still free it. This means that after the free we CANNOT dereference it. Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>