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:
Jim Meyering committed 2014-11-30 18:59:35 -08:00
1 parent 4916618496
commit 3e28ea356a
2 files changed
+8 -1

No files matched your search

+1 -1
View File
@@ -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();
+7
View File
@@ -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