Commit graph

75 commits

Author SHA1 Message Date
Collin Funk 87b0195ace ctags: Use C99 bool instead of defining our own
Use stdbool.h definitions instead of defining non-standard ones.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>

Reviewed by:	markj
MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1107
2024-04-19 14:48:37 -04:00
Warner Losh 5e3934b15a usr.bin: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by:		Netflix
2023-11-26 22:24:01 -07:00
Warner Losh 0b8224d1cc Remove copyright strings ifdef'd out
We've ifdef'd out the copyright strings for some time now. Go ahead and
remove the ifdefs. Plus whatever other detritis was left over from other
recent removals. These copyright strings are present in the comments and
are largely from CSRG's attempt at adding their copyright to every
binary file (which modern interpretations of the license doesn't
require).

Sponsored by:		Netflix
2023-11-26 22:23:58 -07:00
Warner Losh bdcbfde31e usr.bin: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by:		Netflix
2023-11-26 22:23:30 -07:00
Warner Losh b2c76c41be Remove $FreeBSD$: one-line nroff pattern
Remove /^\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:15 -06:00
Warner Losh d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Warner Losh 1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Warner Losh b3e7694832 Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:16 -06:00
Alfonso Gregory 498a0a9c61 Mark usage function as __dead2 in programs where it does not return
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/735
2023-07-07 10:45:18 -06:00
Dag-Erling Smørgrav 7ba6119e22 ctags: Don't undercount lines when handling // comments.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D40374
2023-06-05 17:53:45 +02:00
Dag-Erling Smørgrav 9f35eb8f96 ctags: Recognize __attribute__ in function declarations.
MFC after:	1 week
Obtained from:	NetBSD
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D40264
2023-05-25 18:02:24 +00:00
Dag-Erling Smørgrav 430d064ba5 ctags: Support writing to stdout instead of a file.
* Understand "-" to mean stdout as per convention.
* Check that the output is a regular file and ignore -u if not, otherwise we might try to rm /dev/stdout.
* As a bonus, if -u was specified but the output file does not exist, proceed as if -u had not been specified instead of erroring out.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	cracauer, debdrup
Differential Revision:	https://reviews.freebsd.org/D40237
2023-05-25 13:22:18 +00:00
Dag-Erling Smørgrav 5063211781 ctags: Error out if writing to stdout failed.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	cracauer, allanjude
Differential Revision:	https://reviews.freebsd.org/D40200
2023-05-23 17:31:28 +02:00
Simon J. Gerraty d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
Pedro F. Giffuni 8a16b7a18f General further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.
2017-11-20 19:49:47 +00:00
Bryan Drewery ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Warner Losh fbbd9655e5 Renumber copyright clause 4
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by:	Jan Schaumann <jschauma@stevens.edu>
Pull Request:	https://github.com/freebsd/freebsd/pull/96
2017-02-28 23:42:47 +00:00
Baptiste Daroussin a651f2bc6c Rename getline with get_line to avoid collision with getline(3)
When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added.
This rename is made in preparation for the removal of this guard

Obtained from:	NetBSD
2016-05-10 11:11:23 +00:00
Simon J. Gerraty ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty 44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty 76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty 7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
Marcel Moolenaar 7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Joel Dahl da52b4caaf Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with:	imp, rwatson
2010-12-11 08:32:16 +00:00
David Malone a095a78a13 This now passes a make universe with WARNS=6. 2010-01-08 11:16:58 +00:00
David Malone e42dd26ae1 Change a char that is used as an index into an array into an unisgned char.
Add a missing new style function definition.
2010-01-05 20:32:08 +00:00
Ed Schouten b7946da96b Build usr.bin/ with WARNS=6 by default.
Also add some missing $FreeBSD$ to keep svn happy.
2010-01-02 10:27:05 +00:00
Ralf S. Engelschall 865b0cf06c cleanup code: remove unnecessary and useless void cast
from void-function skip_string().
2007-02-04 20:07:07 +00:00
Ralf S. Engelschall 0c9dffd3af Correct parser by using intended C equality ("==") instead of
assignment ("=") operator.
2007-02-04 20:06:10 +00:00
Ralf S. Engelschall f615552554 fix bug: avoid dereferencing content of an already free(3)'ed chunk 2007-02-04 20:04:29 +00:00
Stefan Farfeleder cd1de708cd Fix type mismatch between char * and unsigned char *. C guarantees that
the values of the characters here are positive, so it's safe to index arrays
with them.
2006-07-18 07:29:42 +00:00
Ruslan Ermilov a866e17077 Added the EXIT STATUS section where appropriate. 2005-01-17 07:44:44 +00:00
Crist J. Clark e075483771 It was pointed out[0] that ctags(1) uses some potentially dangerous
system(3) calls where user-supplied data is used with no sanity
checking. Since ctags(1) is not setuid and is not likely to be used
in a privileged situation, this is not a big deal. However, the
fix is relatively easy and less ugly than the current code, let's be
safe. (I'm sure there are about 2^134 other system(3) calls like this
out there.)

[0] On freebsd-security by Roman Bogorodskiy <bogorodskiy@inbox.ru>
with subject "ctags(1) command execution vulnerability."

MFC after:	3 days
2004-05-07 19:44:40 +00:00
Philippe Charnier a8e0f0e094 The .Xr files 2003-06-08 13:43:56 +00:00
Ruslan Ermilov 06e482e60a mdoc(7) police: markup polishing.
Approved by:	re
2002-11-26 17:33:37 +00:00
David Malone c10b37bf7a ANSIify function definitions to avoid a warning. 2002-07-28 15:50:38 +00:00
Tim J. Robbins 231b81bd22 Document conformance to IEEE Std 1003.1-2001. 2002-05-30 12:13:18 +00:00
Tim J. Robbins 38b8c17f6a Sort sections according to mdoc(7). 2002-05-30 12:02:55 +00:00
Tim J. Robbins df111dde6e Sort entries by locale collating order when -x is specified. 2002-05-30 11:43:20 +00:00
Tim J. Robbins a5d5212371 Create tags for typedefs, structs, unions and enums by default (imply the
-t option). Make a new option, -T, to revert to the old behaviour.
2002-05-30 11:36:12 +00:00
Tim J. Robbins e58bac2e7f Avoid buffer overrun when identifies or filenames are extremely long.
OpenBSD revisions: C.c 1.4-1.5, ctags.c 1.5, fortran.c 1.3, lisp.c 1.3,
tree.c 1.2

Obtained from:	OpenBSD
2002-05-30 10:54:53 +00:00
Tim J. Robbins 880ff11350 Exit non-zero if the tags file cannot be opened. 2002-05-27 03:54:45 +00:00
Philippe Charnier 3898680cf7 Use `The .Nm utility' 2002-04-19 23:44:58 +00:00
Warner Losh f1bb2cd2aa remove __P 2002-03-22 01:22:50 +00:00
David Malone 653b788c5e Add missing "#include <string.h>" for memcmp, noticed by gcc3. 2002-02-27 14:56:58 +00:00
Gregory Neil Shapiro b24e2c8a23 ctags would create a corrupt tags file if the source C file used '//' style
comments such as:

// The main() function

Teach ctags about this style of commenting.

Submitted by:	Eric Allman <eric@Sendmail.ORG>
MFC after:	1 week
2002-02-24 03:02:52 +00:00
Mark Murray 91bd71d206 Remove leaf node WARNS?=2 (that mainly I added). This should
help the GCC3 transition and CURRENT in general.
2002-02-08 22:31:43 +00:00
Andrew Gallatin f9393c5e72 add missing <string.h> to give strcpy() a prototype 2002-02-08 03:01:03 +00:00