17 Commits

Author SHA1 Message Date
Richard Barnes
bf254c75b1 Match malloc signature to its use 2025-05-26 12:08:09 -04:00
Simon Sobisch
9e69eff334 .gitignore adjustments for WIN32 2023-03-01 09:46:26 -05:00
Explorer09
2592576239 build: do not generate lib/Makefile.in.
Files in lib/ are picked up and built using makefile directives in
src/Makefile.am. Remove the need to generate lib/Makefile.in and the
stub lib/Makefile.am.
2017-05-03 13:14:16 -04:00
Explorer09
9c54eb6e30 build: detect overflow for [re]allocate_array.
Use reallocarray() when we have it (i.e. in OpenBSD system). When we
don't, use equivalent overflow detection for our allocate_array and
reallocate_array functions.

Remove lib/reallocarray.c from our LIBOBJS as we no longer need it.

Provide a fallback SIZE_MAX macro definition in flexint.h (not
preprocessor friendly, but enough for our reallocate_array use case).
2017-01-24 07:36:50 -05:00
Will Estes
223f297825 build: explain empty lib/Makefile.am 2016-11-24 18:50:21 -05:00
Explorer09
713f5a0cb4 build: Link $(LIBOBJS) from src/ dir, remove libcompat.la.
The libcompat.la library was small and less friendly to bootstrapping
and cross compilation. Now, we will simply link individual object
files as needed, which is simpler.
2016-11-24 18:45:07 -05:00
Will Estes
80484ea267 Prototyped reallocarray implementation 2016-02-28 16:23:19 -05:00
rlar
9132612c2c warning: no previous prototype for 'do_nothing' [-Wmissing-prototypes] 2016-02-27 17:35:07 -05:00
Tobias Klauser
64f2774378 Converted K&R style function definitions to ANSI C style
Consistently make use of the ANSI C function definition style instead of
the K&R style.
2016-02-16 14:52:16 +01:00
Michael McConville
77e54b25ee Added new function reallocarray.
This is taken from OpenSSH Portable, which in turn takes it from
OpenBSD.

reallocarray wraps the stdlib's realloc function. It takes two size
arguments and checks for overflow, like calloc, but doesn't zero the
memory. Therefore, it allows us to do overflow-safe array reallocations
and overflow-safe unzeroed array allocations, which the stdlib
allocation functions don't.

We have a bunch of specific array allocation macros, none of
which check for overflow. reallocarray should be able to replace them.
2015-12-12 15:25:40 -05:00
Michael Haubenwallner
6c429958e7 Fix malloc/realloc replacement, bug#151.
Signed-off-by: Will Estes <westes575@gmail.com>
2014-04-02 16:51:22 -04:00
Will Estes
a7fa4719ba change crlf line ending to lf 2014-04-02 15:59:14 -04:00
Will Estes
269620b900 move flex program sources into src/ directory
The *.[chly] sources are now in the src directory. This implies a
bunch of changes in Makefile.am and friends to account for the new
location. The .gitignore files are now more local to places where various object files and generated source files occur.
2014-02-16 09:19:51 -05:00
Christoph Junghans
b0ccdd451b Build libfl and libcompat using libtool; resolves #3586814
Signed-off-by: Will Estes <westes575@gmail.com>
2012-12-06 08:50:35 -05:00
Will Estes
0bef977b95 remove unneeded .cvsignore files 2012-07-23 05:37:37 -04:00
Will Estes
83f0c4cac9 provide malloc() and realloc() for systems that do not have satisfactory versions; resolves #1899047 2012-03-21 18:36:28 +00:00
Will Estes
71a1f9ea34 cvsignore files that need that 2012-02-03 22:04:58 +00:00