maint: avoid false-positive used-uninit. warning from gcc
* sed/sed.h (IF_LINT): Define. * sed/compile.c (snarf_char_class) [lint]: Use it to initialize DELIM, so that gcc doesn't report it is used uninitialized.
This commit is contained in:
1 parent
4916618496
commit
3e28ea356a
2 files changed
+8
-1
No files matched your search
+1
-1
@@ -439,7 +439,7 @@ snarf_char_class(b, cur_stat)
|
||||
{
|
||||
int ch;
|
||||
int state = 0;
|
||||
int delim;
|
||||
int delim IF_LINT ( = 0) ;
|
||||
bool pending_mb = 0;
|
||||
|
||||
ch = inchar();
|
||||
|
||||
@@ -262,3 +262,10 @@ extern bool is_utf8;
|
||||
|
||||
extern int brlen (int ch, mbstate_t *ps);
|
||||
extern void initialize_mbcs (void);
|
||||
|
||||
/* Use this to suppress gcc's '...may be used before initialized' warnings. */
|
||||
#ifdef lint
|
||||
# define IF_LINT(Code) Code
|
||||
#else
|
||||
# define IF_LINT(Code) /* empty */
|
||||
#endif
|
||||
Reference in new issue
Block a user