By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,221 Members | 1,662 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,221 IT Pros & Developers. It's quick & easy.

lint

P: n/a
Hello, All!

I often come across the following statements in different source code:

#ifndef lint
char copyright[] =
"@(#) Copyright (C) 2005 bla-bla-bla\n";
#endif

#ifndef lint
static char sccsid[] = "@(#)rshd.c 1.1.2 bla-bla";
#endif

Seems these serve for some kind of version control? Anyway, please explain
me the meaning of it.
Thanks.

With best regards, Roman Mashak. E-mail: mr*@tusur.ru
Nov 15 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Roman Mashak wrote:
Hello, All!

I often come across the following statements in different source code:

#ifndef lint
char copyright[] =
"@(#) Copyright (C) 2005 bla-bla-bla\n";
#endif

#ifndef lint
static char sccsid[] = "@(#)rshd.c 1.1.2 bla-bla";
#endif

Seems these serve for some kind of version control? Anyway, please explain
me the meaning of it.


The arrays `copyright' and `sccsid' are there so these strings become
part of the executable (copyright should be self-explanatory, sccs is,
as you surmised, an id for source/version control).

The reason they're in the `#indef lint' blocks is that otherwise if lint
(or some lint-like tool) is being run against them, these arrays will
(most likely) generate warnings, as they are not used in the code.

HTH,
--ag
--
Artie Gold -- Austin, Texas
http://it-matters.blogspot.com (new post 12/5)
http://www.cafepress.com/goldsays
Nov 15 '05 #2

P: n/a
Hello, Artie!
You wrote on Tue, 28 Jun 2005 23:08:51 -0500:

AG> The arrays `copyright' and `sccsid' are there so these strings become
AG> part of the executable (copyright should be self-explanatory, sccs is,
AG> as you surmised, an id for source/version control).
How is it supposed to use these arrays: informational meaning or some else?
How is it essential to have it in program?
AG> The reason they're in the `#indef lint' blocks is that otherwise if
AG> lint (or some lint-like tool) is being run against them, these arrays
AG> will (most likely) generate warnings, as they are not used in the code.

With best regards, Roman Mashak. E-mail: mr*@tusur.ru
Nov 15 '05 #3

P: n/a
How is it supposed to use these arrays: informational meaning or some else?
The point is to just have it included in the executable. Therefore, if
someone copies it, it is _obvious_ who the copyright owner is just by
searching through the executable w/ a hex editor. Likewise for the
revision number.
How is it essential to have it in program?


It's not essential (at least from a compile/execution perspective -- it
may be essential in terms of company policy wherever that was written).

Jon
----
Learn to program using Linux assembly language
http://www.cafeshops.com/bartlettpublish.8640017
Nov 15 '05 #4

P: n/a
On Wed, 29 Jun 2005 10:10:57 -0400, Jonathan Bartlett
<jo*****@eskimo.com> wrote:
How is it supposed to use these arrays: informational meaning or some else?


The point is to just have it included in the executable. Therefore, if
someone copies it, it is _obvious_ who the copyright owner is just by
searching through the executable w/ a hex editor. Likewise for the
revision number.


In particular there are programs like ident which will search through
for the revision information and display it, so that you can find out
which versions of which modules were used in creating that executable.
How is it essential to have it in program?


It's not essential (at least from a compile/execution perspective -- it
may be essential in terms of company policy wherever that was written).


It may also be essential (from a company policy viewpoint) to have the
code compile or lint free of warnings, hence the preprocessor directives
(having just spent a day getting rid of warnings in code so that it is
allowed to be checked in, it's a pain but has to be done if that' the
policy).

Chris C
Nov 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.