Skip to content
GitLab
菜单
项目
群组
代码片段
帮助
帮助
支持
社区论坛
快捷键
?
提交反馈
登录/注册
切换导航
菜单
打开侧边栏
Panda
TinyCC
提交
49cd6f59
提交
49cd6f59
编辑于
7月 27, 2021
作者:
Steffen Nurpmeso
浏览文件
-W[no-]error: rid of TCCState.warn_none, too; and adjust -h/-hh output
上级
0d59ac48
变更
3
Hide whitespace changes
Inline
Side-by-side
libtcc.c
浏览文件 @
49cd6f59
...
...
@@ -542,9 +542,9 @@ static void error1(int mode, const char *fmt, va_list ap)
tcc_exit_state
();
if
(
mode
==
ERROR_WARN
)
{
if
(
s1
->
warn_
none
)
if
(
s1
->
warn_
mask
&
WARN_DISABLED
)
return
;
if
(
s1
->
warn_mask
&
(
WARN_ERROR
<<
WARN_ERROR_SHIFT
))
if
(
s1
->
warn_mask
&
WARN_ERROR
_MASK
)
/* XXX individual ignorance */
mode
=
ERROR_ERROR
;
}
...
...
@@ -1976,12 +1976,12 @@ reparse:
}
break
;
case
TCC_OPTION_W
:
s
->
warn_
none
=
0
;
s
->
warn_
mask
&=
~
WARN_DISABLED
;
if
(
optarg
[
0
]
&&
set_W_flag
(
s
,
optarg
)
<
0
)
goto
unsupported_option
;
break
;
case
TCC_OPTION_w
:
s
->
warn_
none
=
1
;
s
->
warn_
mask
|=
WARN_DISABLED
;
break
;
case
TCC_OPTION_rdynamic
:
s
->
rdynamic
=
1
;
...
...
tcc.c
浏览文件 @
49cd6f59
...
...
@@ -36,7 +36,7 @@ static const char help[] =
" -std=c99 Conform to the ISO 1999 C standard (default).
\n
"
" -std=c11 Conform to the ISO 2011 C standard.
\n
"
" -Wwarning set or reset (with 'no-' prefix) 'warning' (see tcc -hh)
\n
"
" -w disable all warnings
\n
"
" -w disable all warnings
and their consequences
\n
"
" --version -v show version
\n
"
" -vv show search paths or loaded files
\n
"
" -h -hh show this, show more help
\n
"
...
...
@@ -101,12 +101,12 @@ static const char help2[] =
" -dt with -run/-E: auto-define 'test_...' macros
\n
"
"Ignored options:
\n
"
" --param -pedantic -pipe -s -traditional
\n
"
"-W... warnings:
\n
"
"-W
[no-]
... warnings:
\n
"
" all turn on some (*) warnings
\n
"
" error
stop
after first warning
\n
"
" unsupported warn
about
ignored options, pragmas,
etc.
\n
"
" write-strings strings are const
\n
"
" implicit-function-declaration warn for missing prototype (*)
\n
"
" error
[=(X)]
error out
after first warning
(for X)
\n
"
" unsupported warn
for
ignored options, pragmas,
.. (X)
\n
"
" write-strings strings are const
(*,X)
\n
"
" implicit-function-declaration warn for missing prototype (*
,X
)
\n
"
"-f[no-]... flags:
\n
"
" unsigned-char default char is unsigned
\n
"
" signed-char default char is signed
\n
"
...
...
tcc.h
浏览文件 @
49cd6f59
...
...
@@ -744,10 +744,16 @@ enum warn_option {
WARN_GCC_COMPAT
=
1u
<<
1
,
WARN_WRITE_STRINGS
=
1u
<<
2
,
WARN_IMPLICIT_FUNCTION_DECLARATION
=
1u
<<
3
,
WARN_ERROR
=
1u
<<
4
,
/* Not really as such in warn area, here only "MAX" */
WARN_ALL
=
WARN_ERROR
-
1
/* _ERROR is in lower as "max", there is no warning for it */
WARN_ERROR
=
1u
<<
4
,
WARN_ALL
=
WARN_ERROR
-
1
,
/* Is neither in lower nor upper: disables warnings and errors (-w) */
WARN_DISABLED
=
WARN_ERROR
<<
1
};
enum
{
WARN_ERROR_SHIFT
=
16u
,
WARN_ERROR_MASK
=
(
WARN_ALL
|
WARN_ERROR
)
<<
WARN_ERROR_SHIFT
};
enum
{
WARN_ERROR_SHIFT
=
16u
};
struct
TCCState
{
unsigned
char
verbose
;
/* if true, display some information during compilation */
...
...
@@ -779,7 +785,6 @@ struct TCCState {
unsigned
char
dollars_in_identifiers
;
/* allows '$' char in identifiers */
unsigned
char
ms_bitfields
;
/* if true, emulate MS algorithm for aligning bitfields */
unsigned
char
warn_none
;
/* NEED_WARNING(SELF,X) used to drive W[[no-]error]=X */
uint32_t
warn_mask
;
#define NEED_WARNING(SELF,SWITCH) \
...
...
编辑
预览
Supports
Markdown
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录