Commit Graph

284 Commits

Author SHA1 Message Date
Nicolas Williams
5f63215d0d Always perform == or != operation on cmp function result
Although not required to address bad code generation in
some versions of gcc 9 and 10, a coding style that requires
explicit comparison of the result to zero before use is
both clearer and would have avoided the generation of bad
code.

This change converts all use of cmp function usage from

```
    if (strcmp(a, b) || !strcmp(c, d)) ...
```

to

```
    if (strcmp(a, b) != 0 || strcmp(c, d)) == 0
```

for all C library cmp functions and related:

 - strcmp(), strncmp()
 - strcasecmp(), strncasecmp()
 - stricmp(), strnicmp()
 - memcmp()

Change-Id: Ic60c15e1e3a07e4faaf10648eefe3adae2543188
2021-11-24 22:30:44 -05:00
heitbaum
c7bd01c62a yyerror: update to POSIX standard
To comply with the latest POSIX standard, in Yacc compatibility mode
(options `-y`/`--yacc`) Bison now generates prototypes for yyerror and
yylex.  In some situations, this is breaking compatibility: if the user
has already declared these functions but with some differences (e.g., to
declare them as static, or to use specific attributes), the generated
parser will fail to compile.  To disable these prototypes, #define yyerror
(to `yyerror`), and likewise for yylex.

refer: https://git.savannah.gnu.org/cgit/bison.git/tree/NEWS

GNU Bison 3.8
2021-09-10 09:11:23 +10:00
duncan-mcewan
06c871ef5a Add more test cases for issue #704 2020-11-06 12:55:31 -05:00
duncan-mcewan
72055a2911 Fix incorrect pointer increment
When encountering a backslash character the memmove() call removes it.  But then the pointer p should only be incremented by 1 to skip the escaped character rather than 2, which also skips the character following the escaped one.
2020-11-06 12:55:31 -05:00
Nicolas Williams
a6e6916c1c Fix warning in sl compiler output
Use a cast through uintptr_t to un-const rather than a cast through
unsigned long.  This was caught by the Appeyor Windows build.
2019-01-02 13:56:04 -05:00
Daria Phoebe Brashear
78c915f65a lex: %option not supported by solaris lex
it turns out that we don't need to tell lex we don't plan to use unput;
we can just.... not use unput. however, if we're flex, use the command
line option if it's available, to avoid warnings
2018-12-18 13:12:46 -06:00
Nicolas Williams
1c81ddf4e2 Round #2 of scan-build warnings cleanup 2016-11-16 17:03:14 -06:00
Jeffrey Altman
902aa4ee02 tests on Windows
Modify the NTMakefile rules for tests so that a failed test does
not prevent subsequent tests from being executed.

Change-Id: I9595ad4a1527feae7c402241bf06ab21a0b76d4a
2015-03-21 15:44:48 -04:00
Roland C. Dowdeswell
cc47c8fa7b Turn on -Wextra -Wno-sign-compare -Wno-unused-paramter and fix issues.
We turn on a few extra warnings and fix the fallout that occurs
when building with --enable-developer.  Note that we get different
warnings on different machines and so this will be a work in
progress.  So far, we have built on NetBSD/amd64 5.99.64 (which
uses gcc 4.5.3) and Ubuntu 10.04.3 LTS (which uses gcc 4.4.3).

Notably, we fixed

	1.  a lot of missing structure initialisers,

	2.  unchecked return values for functions that glibc
	    marks as __attribute__((warn-unused-result)),

	3.  made minor modifications to slc and asn1_compile
	    which can generate code which generates warnings,
	    and

	4.  a few stragglers here and there.

We turned off the extended warnings for many programs in appl/ as
they are nearing the end of their useful lifetime, e.g.  rsh, rcp,
popper, ftp and telnet.

Interestingly, glibc's strncmp() macro needed to be worked around
whereas the function calls did not.

We have not yet tried this on 32 bit platforms, so there will be
a few more warnings when we do.
2012-02-20 19:45:41 +00:00
Love Hornquist Astrand
35848f5869 use low match distance for helping, or use ask user to use "help" 2011-11-22 13:58:41 -08:00
Love Hornquist Astrand
00494ac136 use sl_did_you_mean 2011-11-22 12:21:15 -08:00
Love Hornquist Astrand
e0613d6aa6 use ? 2011-11-22 12:19:04 -08:00
Love Hornquist Astrand
d26df6ba7f export sl_did_you_mean that uses OptimalStringAlignmentDistance to propose an alternative 2011-11-22 12:18:37 -08:00
Love Hörnquist Åstrand
1fe4d77846 remove getprogname.c 2011-10-28 20:36:40 -07:00
Love Hörnquist Åstrand
b4972bd4f0 no longer need getprogname() 2011-10-28 19:31:05 -07:00
Love Hörnquist Åstrand
3570802d59 use getprogname if we have, otherwise punt, remove roken dependency 2011-10-28 19:30:55 -07:00
Jeffrey Altman
c3f6a65da2 slc: correct 'min_args' and 'max_args' processing
The 'min_args' and 'max_args' values were ignored whenever
an 'argument' value was not present as a child of the 'command'.
'argument' values are often specified as children of the 'option'
value when more than one 'option' is an argument.

This patchset counts the number of 'argument' values specified
under a 'command' regardless of the level at which it appears.
If there are any 'argument' values, the 'min_args' and 'max_args'
are used to generate validation code for the 'command'.

Change-Id: Idc6129b4ff29914ac990f693b4dba51a30bdc971
2011-07-27 19:55:28 -04:00
Love Hörnquist Åstrand
7aaba443bc add NTMakefile and windows directories 2011-07-17 12:16:59 -07:00
Love Hornquist Astrand
0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00
Love Hornquist Astrand
c7c22aef44 clean slc-lex.c 2011-05-18 22:15:49 -07:00
Love Hornquist Astrand
f5f9014c90 Warning fixes from Christos Zoulas
- shadowed variables
- signed/unsigned confusion
- const lossage
- incomplete structure initializations
- unused code
2011-04-29 20:25:05 -07:00
Love Hornquist Astrand
f13335985f try %option nounput and see if we can remove a warning 2010-11-26 12:01:14 -08:00
Love Hornquist Astrand
99bc078d46 better support for name in options 2010-11-24 16:21:26 -08:00
Asanka C. Herath
e84b73370c Avoid conflicting malloc/free declarations in Bison 2010-11-24 15:33:28 -05:00
Asanka C. Herath
610bd66bbd Windows: Support building using newer flex 2010-11-24 15:32:29 -05:00
Asanka C. Herath
1b32efe62c Windows: Include manifest dependencies by default when building tools 2010-11-24 15:32:20 -05:00
Asanka C. Herath
f40fe926ad Windows: Comprehensive clean target 2010-11-24 15:32:13 -05:00
Asanka Herath
ea4d8dbfdb Windows: Use EXEPREP and DLLPREP macros for processing binaries
Once DLLs and EXEs are built, they need to have their manifests
processed and signed.  These steps are encapsulated in the EXEPREP and
DLLPREP Makefile macros.  Use them instead of invoking each processing
macro individually.
2010-08-20 13:04:06 -04:00
Love Hornquist Astrand
c6bbdb545b First drop of Windows build infrastructure from Secure Endpoints 2009-11-24 12:12:53 -08:00
Love Hornquist Astrand
46443d23bb install tools in libexec/heimdal, fix deps 2009-09-16 05:59:54 -07:00
Love Hornquist Astrand
6a56476258 drop RCSID 2009-09-07 21:25:05 -07:00
Love Hornquist Astrand
a26bd9bd2f slctest doesn't depend on LEXLIB, slc does though, reorder LDADD 2009-08-14 15:42:46 +02:00
Love Hornquist Astrand
c961189f95 Remove dead code [CID-10] 2009-07-30 10:55:06 +02:00
Love Hörnquist Åstrand
39bf5acf73 rename different symbols
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24765 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-02-17 02:51:20 +00:00
Love Hörnquist Åstrand
431bcf82fe Move lexlib before libroken to make sure we don't get an empty line. From John Center.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24629 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-02-07 04:05:12 +00:00
Love Hörnquist Åstrand
1ee6bd7248 drop RCSID
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24357 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-01-25 00:30:49 +00:00
Love Hörnquist Åstrand
6937d41a02 remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 09:21:03 +00:00
Love Hörnquist Åstrand
e172367898 switch to utf8 encoding of all files
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23814 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 08:53:55 +00:00
Love Hörnquist Åstrand
58227c2f5f negative flags defaults to on
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23683 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-08-25 11:11:58 +00:00
Love Hörnquist Åstrand
db63919ed3 remove dead store
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23661 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-08-25 02:30:26 +00:00
Love Hörnquist Åstrand
48aecb8bdf drop libss and make_cmds
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23160 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-05-05 09:49:30 +00:00
Love Hörnquist Åstrand
8d40c2994b check return value of alloc functions, from Charles Longeau
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21745 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-07-31 16:11:25 +00:00
Love Hörnquist Åstrand
57d4edc236 x
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21626 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-07-17 07:48:42 +00:00
Love Hörnquist Åstrand
29faccf940 roken_rename.h is a dist_ source
k


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21625 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-07-17 07:48:26 +00:00
Love Hörnquist Åstrand
1e2f5e24ad x
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21622 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-07-17 07:36:07 +00:00
Love Hörnquist Åstrand
6e21ab742e split source files in dist and nodist.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21621 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-07-17 07:35:52 +00:00
Love Hörnquist Åstrand
286da566e9 x
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21453 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-07-10 12:48:43 +00:00
Love Hörnquist Åstrand
7b75dd792c New library version.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21452 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-07-10 12:48:28 +00:00
Love Hörnquist Åstrand
5b9369bb0f Unbugger, really.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21160 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-18 22:58:21 +00:00
Love Hörnquist Åstrand
0cc0795250 x
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21148 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-18 21:39:20 +00:00