0

What is the constant LINT_ARGS in C programming? I have seen it in C programs like

#ifdef LINT_ARGS
//bla bla bla

It is also mentioned here.

I am a beginner so please keep your answer simple.

Shy
  • 542
  • 8
  • 20
  • Relevant http://stackoverflow.com/questions/3744608/the-role-of-ifdef-and-ifndef – StoryTeller - Unslander Monica Apr 06 '17 at 09:30
  • The term *lint* comes from a [program](https://en.wikipedia.org/wiki/Lint_(software)) but is now used as a generic term for [*static program analysis*](https://en.wikipedia.org/wiki/Static_program_analysis). It's likely that the macro is set by a "linter" (static analysis program) to identify that it's such a program parsing your program. – Some programmer dude Apr 06 '17 at 09:30
  • 2
    A lot of stuff mentioned in that page are total crap in 2017. But I don't blame the author: it may have been a decent advice in 1987 as originally written ;-) Why are you reading some 30 year old "good practices" *now*? – P.P Apr 06 '17 at 09:34

1 Answers1

0

LINT_ARG is a macro used to put a check if user want to validate the function prototype mostly in Microsoft C.

So if this macro is not defined then compiler may fire a warning/error of function not found or like wise. But after the MSC version 4 it is enabled by default.

See below usage example:

/*
 * Prototypes for local functions:
 */
#ifdef LINT_ARGS
static u16 MTU_alloc_dlg_id(u16 *dlg_id);
static u8 MTU_alloc_invoke_id(void);
#endif
Hemant
  • 123
  • 10