adlint 1.6.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +389 -37
- data/INSTALL +3 -0
- data/MANIFEST +7 -0
- data/NEWS +50 -10
- data/etc/conf.d/i686-mingw/cinit-gcc_4.6.1.erb +1 -1
- data/etc/mesg.d/en_US/messages.yml +7 -7
- data/etc/mesg.d/ja_JP/messages.yml +4 -4
- data/lib/adlint/c/branch.rb +4 -4
- data/lib/adlint/c/code.rb +11 -13
- data/lib/adlint/c/enum.rb +0 -2
- data/lib/adlint/c/environ.rb +13 -7
- data/lib/adlint/c/expr.rb +5 -1
- data/lib/adlint/c/interp.rb +10 -6
- data/lib/adlint/c/mediator.rb +1 -0
- data/lib/adlint/c/message.rb +294 -111
- data/lib/adlint/c/message_shima.rb +63 -0
- data/lib/adlint/c/metric.rb +25 -13
- data/lib/adlint/c/object.rb +168 -31
- data/lib/adlint/c/parser.rb +3 -3
- data/lib/adlint/c/phase.rb +20 -3
- data/lib/adlint/c/syntax.rb +175 -17
- data/lib/adlint/c/value.rb +199 -126
- data/lib/adlint/cpp/asm.rb +4 -4
- data/lib/adlint/cpp/constexpr.rb +1 -1
- data/lib/adlint/cpp/eval.rb +6 -4
- data/lib/adlint/cpp/message.rb +100 -7
- data/lib/adlint/cpp/phase.rb +12 -1
- data/lib/adlint/cpp/source.rb +2 -2
- data/lib/adlint/cpp/subst.rb +2 -4
- data/lib/adlint/lang.rb +5 -3
- data/lib/adlint/ld/metric.rb +1 -1
- data/lib/adlint/version.rb +2 -2
- data/share/demo/Makefile +5 -0
- data/share/demo/bad_include/bad_include.c +13 -0
- data/share/demo/bad_include/test'1'.h +0 -0
- data/share/demo/bad_include/test'2'.h +0 -0
- data/share/demo/incomplete_ifelse/incomplete_ifelse.c +29 -0
- data/share/demo/inline_asm/inline_asm.c +25 -0
- data/share/demo/invalid_call/invalid_call.c +12 -4
- data/share/demo/logical_expr/logical_expr.c +73 -0
- data/share/demo/register_vars/register_vars.c +12 -0
- data/share/demo/typedef_each_src/typedef_each_src.c +9 -0
- data/share/demo/wrap_around/wrap_around.c +17 -0
- data/share/doc/developers_guide_ja.html +3 -3
- data/share/doc/developers_guide_ja.texi +1 -1
- data/share/doc/users_guide_en.html +137 -102
- data/share/doc/users_guide_en.texi +121 -86
- data/share/doc/users_guide_ja.html +118 -91
- data/share/doc/users_guide_ja.texi +103 -76
- metadata +10 -3
@@ -2,7 +2,7 @@
|
|
2
2
|
@setfilename users_guide_en.info
|
3
3
|
@documentlanguage en
|
4
4
|
@documentencoding utf-8
|
5
|
-
@settitle AdLint 1.
|
5
|
+
@settitle AdLint 1.8.0 User's Guide
|
6
6
|
|
7
7
|
@copying
|
8
8
|
Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
|
@@ -2536,7 +2536,7 @@ context_line
|
|
2536
2536
|
* W0535::A comma operator is used in a 'for' statement.
|
2537
2537
|
* W0538::This 'default' label is not final label in this 'switch' statement.
|
2538
2538
|
* W0540::A function which the blank formal argument list is declared. `void' is omitted.
|
2539
|
-
* W0541::
|
2539
|
+
* W0541::Inline assembly code should be encapsulated by macro.
|
2540
2540
|
* W0542::There are identifiers in the part of formal argument in a function declaration.
|
2541
2541
|
* W0543::The identifier of formal argument in this function declaration is different from the past declaration of it.
|
2542
2542
|
* W0544::The identifier of formal argument in the function declaration is different from the declaration of function pointer.
|
@@ -2601,8 +2601,8 @@ context_line
|
|
2601
2601
|
* W0627::There is a dead letter (only `;') in the following other code.
|
2602
2602
|
* W0628::A function `%s' is defined, but this is not used in this project.
|
2603
2603
|
* W0629::A static function `%s()' is not used in this translation unit.
|
2604
|
-
* W0632::
|
2605
|
-
* W0633::
|
2604
|
+
* W0632::Using ' or " characters in `#include <%s>' directive makes undefined behavior.
|
2605
|
+
* W0633::Using ' character in `#include "%s"' directive makes undefined behavior.
|
2606
2606
|
* W0634::`\' is used in `#include' line. `/' is recommended for the path delimiter.
|
2607
2607
|
* W0635::The type doesn't match with %sth conversion specifier and the corresponding actual argument.
|
2608
2608
|
* W0636::An actual argument doesn't exist correspond to %sth conversion specifier.
|
@@ -2653,9 +2653,9 @@ context_line
|
|
2653
2653
|
* W0685::A character preceding the `-' in scanset o `[]' is bigger than a character following the `-'.
|
2654
2654
|
* W0686::The same characters are described in scanset (characters enclosed by `[]').
|
2655
2655
|
* W0687::#undef is using to delete #defined operator.
|
2656
|
-
* W0688::There is no line number in 1 to 32767 ranges after
|
2657
|
-
* W0689::#line
|
2658
|
-
* W0690::
|
2656
|
+
* W0688::There is no line number in 1 to 32767 ranges after #line directive.
|
2657
|
+
* W0689::#line directive syntax doesn't match `#line integer constant \"string\"'.
|
2658
|
+
* W0690::No line number after #line directive.
|
2659
2659
|
* W0691::The result of `##' operator is not valid preprocessing token.
|
2660
2660
|
* W0692::A function-like macro doesn't given an actual argument.
|
2661
2661
|
* W0693::A function-like macro is called by actual argument which its definition is smaller.
|
@@ -23620,7 +23620,7 @@ None.
|
|
23620
23620
|
|
23621
23621
|
@subsection Message body
|
23622
23622
|
|
23623
|
-
|
23623
|
+
Inline assembly code should be encapsulated by macro.
|
23624
23624
|
|
23625
23625
|
@subsection Content
|
23626
23626
|
|
@@ -23629,6 +23629,8 @@ Under construction.
|
|
23629
23629
|
@subsection Sample code
|
23630
23630
|
|
23631
23631
|
@verbatim
|
23632
|
+
#define ASM_CODE asm("movl %ecx, %eax")
|
23633
|
+
|
23632
23634
|
void foo(int arg1, int *arg2, int arg3)
|
23633
23635
|
{
|
23634
23636
|
asm("movl %ecx, %eax"); /* W0541 */
|
@@ -23638,6 +23640,8 @@ void foo(int arg1, int *arg2, int arg3)
|
|
23638
23640
|
xorl eax, eax
|
23639
23641
|
}
|
23640
23642
|
|
23643
|
+
ASM_CODE; /* OK */
|
23644
|
+
|
23641
23645
|
__asm__ volatile ( /* W0541 */
|
23642
23646
|
"int $0x80"
|
23643
23647
|
: "=a" (r)
|
@@ -25337,17 +25341,16 @@ An integer expression which the value which the value is minus converted to unsi
|
|
25337
25341
|
|
25338
25342
|
@subsection Content
|
25339
25343
|
|
25340
|
-
@b{This message will be supported in AdLint 2.0.0}
|
25341
|
-
|
25342
25344
|
Under construction.
|
25343
25345
|
|
25344
25346
|
@subsection Sample code
|
25345
25347
|
|
25346
25348
|
@verbatim
|
25347
|
-
int a
|
25348
|
-
|
25349
|
-
if (a < 0) {
|
25350
|
-
|
25349
|
+
void func(int a)
|
25350
|
+
{
|
25351
|
+
if (a < 0) {
|
25352
|
+
unsigned int b = (unsigned int) a; /* W0607 */
|
25353
|
+
}
|
25351
25354
|
}
|
25352
25355
|
@end verbatim
|
25353
25356
|
|
@@ -25359,7 +25362,7 @@ if (a < 0) {
|
|
25359
25362
|
|
25360
25363
|
@subsection Since
|
25361
25364
|
|
25362
|
-
|
25365
|
+
1.8.0
|
25363
25366
|
|
25364
25367
|
@node W0608
|
25365
25368
|
@section W0608
|
@@ -25371,14 +25374,19 @@ An integer expression which the value might be minus converted to unsigned type.
|
|
25371
25374
|
|
25372
25375
|
@subsection Content
|
25373
25376
|
|
25374
|
-
@b{This message will be supported in AdLint 2.0.0}
|
25375
|
-
|
25376
25377
|
Under construction.
|
25377
25378
|
|
25378
25379
|
@subsection Sample code
|
25379
25380
|
|
25380
25381
|
@verbatim
|
25381
|
-
|
25382
|
+
void fuu(int a)
|
25383
|
+
{
|
25384
|
+
unsigned char b;
|
25385
|
+
|
25386
|
+
if (a < 256) {
|
25387
|
+
b = (unsigned char) a; /* W0608 */
|
25388
|
+
}
|
25389
|
+
}
|
25382
25390
|
@end verbatim
|
25383
25391
|
|
25384
25392
|
@subsection Related message
|
@@ -25389,7 +25397,7 @@ Under construction.
|
|
25389
25397
|
|
25390
25398
|
@subsection Since
|
25391
25399
|
|
25392
|
-
|
25400
|
+
1.8.0
|
25393
25401
|
|
25394
25402
|
@node W0609
|
25395
25403
|
@section W0609
|
@@ -25723,14 +25731,19 @@ None.
|
|
25723
25731
|
|
25724
25732
|
@subsection Content
|
25725
25733
|
|
25726
|
-
@b{This message will be supported in AdLint 2.0.0}
|
25727
|
-
|
25728
25734
|
Under construction.
|
25729
25735
|
|
25730
25736
|
@subsection Sample code
|
25731
25737
|
|
25732
25738
|
@verbatim
|
25733
|
-
|
25739
|
+
typedef int *INT_PTR; /* W0625 */
|
25740
|
+
|
25741
|
+
extern INT_PTR func(void);
|
25742
|
+
|
25743
|
+
INT_PTR func(void)
|
25744
|
+
{
|
25745
|
+
return 0;
|
25746
|
+
}
|
25734
25747
|
@end verbatim
|
25735
25748
|
|
25736
25749
|
@subsection Related message
|
@@ -25739,7 +25752,7 @@ None.
|
|
25739
25752
|
|
25740
25753
|
@subsection Since
|
25741
25754
|
|
25742
|
-
|
25755
|
+
1.8.0
|
25743
25756
|
|
25744
25757
|
@node W0626
|
25745
25758
|
@section W0626
|
@@ -25885,30 +25898,28 @@ int func2(void)
|
|
25885
25898
|
|
25886
25899
|
@subsection Message body
|
25887
25900
|
|
25888
|
-
|
25901
|
+
Using ' or " characters in `@code{#include <%s>}' directive makes undefined behavior.
|
25889
25902
|
|
25890
25903
|
@subsection Content
|
25891
25904
|
|
25892
|
-
@b{This message will be supported in AdLint 2.0.0}
|
25893
|
-
|
25894
25905
|
Under construction.
|
25895
25906
|
|
25896
25907
|
@subsection Sample code
|
25897
25908
|
|
25898
25909
|
@verbatim
|
25899
|
-
|
25910
|
+
#include <NG'_header.h> /* W0632 */
|
25900
25911
|
@end verbatim
|
25901
25912
|
|
25902
25913
|
@subsection Related message
|
25903
25914
|
|
25904
25915
|
@itemize
|
25905
|
-
@item @ref{W0633}
|
25916
|
+
@item @ref{W0633} Using ' character in `#include "%s"' directive makes undefined behavior.
|
25906
25917
|
@item @ref{W0634} `\' is used in `#include' line. `/' is recommended for the path delimiter.
|
25907
25918
|
@end itemize
|
25908
25919
|
|
25909
25920
|
@subsection Since
|
25910
25921
|
|
25911
|
-
|
25922
|
+
1.8.0
|
25912
25923
|
|
25913
25924
|
@node W0633
|
25914
25925
|
@section W0633
|
@@ -25916,30 +25927,28 @@ Under construction.
|
|
25916
25927
|
|
25917
25928
|
@subsection Message body
|
25918
25929
|
|
25919
|
-
|
25930
|
+
Using ' character in `@code{#include "%s"}' directive makes undefined behavior.
|
25920
25931
|
|
25921
25932
|
@subsection Content
|
25922
25933
|
|
25923
|
-
@b{This message will be supported in AdLint 2.0.0}
|
25924
|
-
|
25925
25934
|
Under construction.
|
25926
25935
|
|
25927
25936
|
@subsection Sample code
|
25928
25937
|
|
25929
25938
|
@verbatim
|
25930
|
-
|
25939
|
+
#include "NG'_header.h" /* W0633 */
|
25931
25940
|
@end verbatim
|
25932
25941
|
|
25933
25942
|
@subsection Related message
|
25934
25943
|
|
25935
25944
|
@itemize
|
25936
|
-
@item @ref{W0632}
|
25945
|
+
@item @ref{W0632} Using ' or " characters in `#include <%s>' directive makes undefined behavior.
|
25937
25946
|
@item @ref{W0634} `\' is used in `#include' line. `/' is recommended for the path delimiter.
|
25938
25947
|
@end itemize
|
25939
25948
|
|
25940
25949
|
@subsection Since
|
25941
25950
|
|
25942
|
-
|
25951
|
+
1.8.0
|
25943
25952
|
|
25944
25953
|
@node W0634
|
25945
25954
|
@section W0634
|
@@ -25951,26 +25960,25 @@ Under construction.
|
|
25951
25960
|
|
25952
25961
|
@subsection Content
|
25953
25962
|
|
25954
|
-
@b{This message will be supported in AdLint 2.0.0}
|
25955
|
-
|
25956
25963
|
Under construction.
|
25957
25964
|
|
25958
25965
|
@subsection Sample code
|
25959
25966
|
|
25960
25967
|
@verbatim
|
25961
|
-
|
25968
|
+
#include "..\ng\header.h" /* W0634 */
|
25969
|
+
#include "..\\ng\\header.h" /* W0634 */
|
25962
25970
|
@end verbatim
|
25963
25971
|
|
25964
25972
|
@subsection Related message
|
25965
25973
|
|
25966
25974
|
@itemize
|
25967
|
-
@item @ref{W0632}
|
25968
|
-
@item @ref{W0633}
|
25975
|
+
@item @ref{W0632} Using ' or " characters in `#include <%s>' directive makes undefined behavior.
|
25976
|
+
@item @ref{W0633} Using ' character in `#include "%s"' directive makes undefined behavior.
|
25969
25977
|
@end itemize
|
25970
25978
|
|
25971
25979
|
@subsection Since
|
25972
25980
|
|
25973
|
-
|
25981
|
+
1.8.0
|
25974
25982
|
|
25975
25983
|
@node W0635
|
25976
25984
|
@section W0635
|
@@ -26217,15 +26225,18 @@ It is impossible to get the array's address which declared with 'register'.
|
|
26217
26225
|
|
26218
26226
|
@subsection Content
|
26219
26227
|
|
26220
|
-
@b{This message will be supported in AdLint 2.0.0}
|
26221
|
-
|
26222
26228
|
Under construction.
|
26223
26229
|
|
26224
26230
|
@subsection Sample code
|
26225
26231
|
|
26226
26232
|
@verbatim
|
26227
|
-
|
26228
|
-
|
26233
|
+
void func(void)
|
26234
|
+
{
|
26235
|
+
register int a[3];
|
26236
|
+
|
26237
|
+
int *p1 = a; /* W0642 */
|
26238
|
+
int *p2 = &a[1]; /* W0642 */
|
26239
|
+
}
|
26229
26240
|
@end verbatim
|
26230
26241
|
|
26231
26242
|
@subsection Related message
|
@@ -26239,7 +26250,7 @@ int* p = arr1;
|
|
26239
26250
|
|
26240
26251
|
@subsection Since
|
26241
26252
|
|
26242
|
-
|
26253
|
+
1.8.0
|
26243
26254
|
|
26244
26255
|
@node W0643
|
26245
26256
|
@section W0643
|
@@ -28512,9 +28523,9 @@ Under construction.
|
|
28512
28523
|
@subsection Related message
|
28513
28524
|
|
28514
28525
|
@itemize
|
28515
|
-
@item @ref{W0688} There is no line number in 1 to 32767 ranges after
|
28516
|
-
@item @ref{W0689} #line
|
28517
|
-
@item @ref{W0690}
|
28526
|
+
@item @ref{W0688} There is no line number in 1 to 32767 ranges after #line directive.
|
28527
|
+
@item @ref{W0689} #line directive syntax doesn't match `#line integer constant \"string\"'.
|
28528
|
+
@item @ref{W0690} No line number after #line directive.
|
28518
28529
|
@item @ref{W0691} The result of `##' operator is not valid preprocessing token.
|
28519
28530
|
@end itemize
|
28520
28531
|
|
@@ -28528,7 +28539,7 @@ Under construction.
|
|
28528
28539
|
|
28529
28540
|
@subsection Message body
|
28530
28541
|
|
28531
|
-
There is no line number in 1 to 32767 ranges after
|
28542
|
+
There is no line number in 1 to 32767 ranges after #line directive.
|
28532
28543
|
|
28533
28544
|
@subsection Content
|
28534
28545
|
|
@@ -28544,8 +28555,8 @@ Under construction.
|
|
28544
28555
|
|
28545
28556
|
@itemize
|
28546
28557
|
@item @ref{W0687} #undef is using to delete #defined operator.
|
28547
|
-
@item @ref{W0689} #line
|
28548
|
-
@item @ref{W0690}
|
28558
|
+
@item @ref{W0689} #line directive syntax doesn't match `#line integer constant \"string\"'.
|
28559
|
+
@item @ref{W0690} No line number after #line directive.
|
28549
28560
|
@item @ref{W0691} The result of `##' operator is not valid preprocessing token.
|
28550
28561
|
@end itemize
|
28551
28562
|
|
@@ -28559,7 +28570,7 @@ Under construction.
|
|
28559
28570
|
|
28560
28571
|
@subsection Message body
|
28561
28572
|
|
28562
|
-
#line
|
28573
|
+
#line directive syntax doesn't match `#line integer constant \"string\"'.
|
28563
28574
|
|
28564
28575
|
@subsection Content
|
28565
28576
|
|
@@ -28578,8 +28589,8 @@ Under construction.
|
|
28578
28589
|
|
28579
28590
|
@itemize
|
28580
28591
|
@item @ref{W0687} #undef is using to delete #defined operator.
|
28581
|
-
@item @ref{W0688} There is no line number in 1 to 32767 ranges after
|
28582
|
-
@item @ref{W0690}
|
28592
|
+
@item @ref{W0688} There is no line number in 1 to 32767 ranges after #line directive.
|
28593
|
+
@item @ref{W0690} No line number after #line directive.
|
28583
28594
|
@item @ref{W0691} The result of `##' operator is not valid preprocessing token.
|
28584
28595
|
@end itemize
|
28585
28596
|
|
@@ -28593,7 +28604,7 @@ Under construction.
|
|
28593
28604
|
|
28594
28605
|
@subsection Message body
|
28595
28606
|
|
28596
|
-
|
28607
|
+
No line number after #line directive.
|
28597
28608
|
|
28598
28609
|
@subsection Content
|
28599
28610
|
|
@@ -28610,8 +28621,8 @@ Under construction.
|
|
28610
28621
|
|
28611
28622
|
@itemize
|
28612
28623
|
@item @ref{W0687} #undef is using to delete #defined operator.
|
28613
|
-
@item @ref{W0688} There is no line number in 1 to 32767 ranges after
|
28614
|
-
@item @ref{W0689} #line
|
28624
|
+
@item @ref{W0688} There is no line number in 1 to 32767 ranges after #line directive.
|
28625
|
+
@item @ref{W0689} #line directive syntax doesn't match `#line integer constant \"string\"'.
|
28615
28626
|
@item @ref{W0691} The result of `##' operator is not valid preprocessing token.
|
28616
28627
|
@end itemize
|
28617
28628
|
|
@@ -28643,9 +28654,9 @@ Under construction.
|
|
28643
28654
|
|
28644
28655
|
@itemize
|
28645
28656
|
@item @ref{W0687} #undef is using to delete #defined operator.
|
28646
|
-
@item @ref{W0688} There is no line number in 1 to 32767 ranges after
|
28647
|
-
@item @ref{W0689} #line
|
28648
|
-
@item @ref{W0690}
|
28657
|
+
@item @ref{W0688} There is no line number in 1 to 32767 ranges after #line directive.
|
28658
|
+
@item @ref{W0689} #line directive syntax doesn't match `#line integer constant \"string\"'.
|
28659
|
+
@item @ref{W0690} No line number after #line directive.
|
28649
28660
|
@end itemize
|
28650
28661
|
|
28651
28662
|
@subsection Since
|
@@ -29117,14 +29128,15 @@ Right operand of relational operator is a substantive 'boolean' expression.
|
|
29117
29128
|
|
29118
29129
|
@subsection Content
|
29119
29130
|
|
29120
|
-
@b{This message will be supported in AdLint 2.0.0}
|
29121
|
-
|
29122
29131
|
Under construction.
|
29123
29132
|
|
29124
29133
|
@subsection Sample code
|
29125
29134
|
|
29126
29135
|
@verbatim
|
29127
|
-
|
29136
|
+
int func(int a, int b, int c, int d)
|
29137
|
+
{
|
29138
|
+
return (a + b) > (c > d); /* W0711 */
|
29139
|
+
}
|
29128
29140
|
@end verbatim
|
29129
29141
|
|
29130
29142
|
@subsection Related message
|
@@ -29136,7 +29148,7 @@ x = (a + b) > (c > d); /* W0711 */
|
|
29136
29148
|
|
29137
29149
|
@subsection Since
|
29138
29150
|
|
29139
|
-
|
29151
|
+
1.8.0
|
29140
29152
|
|
29141
29153
|
@node W0712
|
29142
29154
|
@section W0712
|
@@ -29148,14 +29160,15 @@ Left operand of relational operator is a substantive 'boolean' expression.
|
|
29148
29160
|
|
29149
29161
|
@subsection Content
|
29150
29162
|
|
29151
|
-
@b{This message will be supported in AdLint 2.0.0}
|
29152
|
-
|
29153
29163
|
Under construction.
|
29154
29164
|
|
29155
29165
|
@subsection Sample code
|
29156
29166
|
|
29157
29167
|
@verbatim
|
29158
|
-
|
29168
|
+
int func(int a, int b, int c, int d)
|
29169
|
+
{
|
29170
|
+
return (a > b) > (c + d); /* W0712 */
|
29171
|
+
}
|
29159
29172
|
@end verbatim
|
29160
29173
|
|
29161
29174
|
@subsection Related message
|
@@ -29167,7 +29180,7 @@ x = (a > b) > (c + d); /* W0712 */
|
|
29167
29180
|
|
29168
29181
|
@subsection Since
|
29169
29182
|
|
29170
|
-
|
29183
|
+
1.8.0
|
29171
29184
|
|
29172
29185
|
@node W0713
|
29173
29186
|
@section W0713
|
@@ -29179,14 +29192,15 @@ Both sides of relational operator is substantive 'boolean' expressions.
|
|
29179
29192
|
|
29180
29193
|
@subsection Content
|
29181
29194
|
|
29182
|
-
@b{This message will be supported in AdLint 2.0.0}
|
29183
|
-
|
29184
29195
|
Under construction.
|
29185
29196
|
|
29186
29197
|
@subsection Sample code
|
29187
29198
|
|
29188
29199
|
@verbatim
|
29189
|
-
|
29200
|
+
int func(int a, int b, int c, int d)
|
29201
|
+
{
|
29202
|
+
return (a > b) > (c > d); /* W0713 */
|
29203
|
+
}
|
29190
29204
|
@end verbatim
|
29191
29205
|
|
29192
29206
|
@subsection Related message
|
@@ -29198,7 +29212,7 @@ x = (a > b) > (c > d); /* W0713 */
|
|
29198
29212
|
|
29199
29213
|
@subsection Since
|
29200
29214
|
|
29201
|
-
|
29215
|
+
1.8.0
|
29202
29216
|
|
29203
29217
|
@node W0714
|
29204
29218
|
@section W0714
|
@@ -29210,14 +29224,15 @@ Both sides of `&' operator is substantive 'boolean' expressions.
|
|
29210
29224
|
|
29211
29225
|
@subsection Content
|
29212
29226
|
|
29213
|
-
@b{This message will be supported in AdLint 2.0.0}
|
29214
|
-
|
29215
29227
|
Under construction.
|
29216
29228
|
|
29217
29229
|
@subsection Sample code
|
29218
29230
|
|
29219
29231
|
@verbatim
|
29220
|
-
|
29232
|
+
int func(int a, int b, int c, int d)
|
29233
|
+
{
|
29234
|
+
return (a > b) & (c > d); /* W0714 */
|
29235
|
+
}
|
29221
29236
|
@end verbatim
|
29222
29237
|
|
29223
29238
|
@subsection Related message
|
@@ -29231,7 +29246,7 @@ Under construction.
|
|
29231
29246
|
|
29232
29247
|
@subsection Since
|
29233
29248
|
|
29234
|
-
|
29249
|
+
1.8.0
|
29235
29250
|
|
29236
29251
|
@node W0715
|
29237
29252
|
@section W0715
|
@@ -29243,14 +29258,15 @@ Both sides of `|' operator is substantive 'boolean' expressions.
|
|
29243
29258
|
|
29244
29259
|
@subsection Content
|
29245
29260
|
|
29246
|
-
@b{This message will be supported in AdLint 2.0.0}
|
29247
|
-
|
29248
29261
|
Under construction.
|
29249
29262
|
|
29250
29263
|
@subsection Sample code
|
29251
29264
|
|
29252
29265
|
@verbatim
|
29253
|
-
|
29266
|
+
int func(int a, int b, int c, int d)
|
29267
|
+
{
|
29268
|
+
return (a > b) | (c > d); /* W0715 */
|
29269
|
+
}
|
29254
29270
|
@end verbatim
|
29255
29271
|
|
29256
29272
|
@subsection Related message
|
@@ -29264,7 +29280,7 @@ Under construction.
|
|
29264
29280
|
|
29265
29281
|
@subsection Since
|
29266
29282
|
|
29267
|
-
|
29283
|
+
1.8.0
|
29268
29284
|
|
29269
29285
|
@node W0716
|
29270
29286
|
@section W0716
|
@@ -29688,7 +29704,7 @@ enum Fruits { APPLE, BANANA, ORANGE };
|
|
29688
29704
|
void func(void)
|
29689
29705
|
{
|
29690
29706
|
enum Color c;
|
29691
|
-
|
29707
|
+
|
29692
29708
|
c = ORANGE; /* W0729 */
|
29693
29709
|
}
|
29694
29710
|
@end verbatim
|
@@ -32824,14 +32840,33 @@ An inline assembly syntax is using. This is the language extension. This code wi
|
|
32824
32840
|
|
32825
32841
|
@subsection Content
|
32826
32842
|
|
32827
|
-
@b{This message will be supported in AdLint 2.0.0}
|
32828
|
-
|
32829
32843
|
Under construction.
|
32830
32844
|
|
32831
32845
|
@subsection Sample code
|
32832
32846
|
|
32833
32847
|
@verbatim
|
32834
|
-
|
32848
|
+
#define ASM_CODE asm("movl %ecx, %eax")
|
32849
|
+
|
32850
|
+
void foo(int arg1, int *arg2, int arg3)
|
32851
|
+
{
|
32852
|
+
asm("movl %ecx, %eax"); /* W0832 */
|
32853
|
+
__asm__("movl %ecx, (%eax)"); /* W0832 */
|
32854
|
+
|
32855
|
+
asm { /* W0832 */
|
32856
|
+
xorl eax, eax
|
32857
|
+
}
|
32858
|
+
|
32859
|
+
ASM_CODE; /* W0832 */
|
32860
|
+
|
32861
|
+
__asm__ volatile ( /* W0832 */
|
32862
|
+
"int $0x80"
|
32863
|
+
: "=a" (r)
|
32864
|
+
"+b" (arg1),
|
32865
|
+
"+c" (arg2),
|
32866
|
+
"+d" (arg3)
|
32867
|
+
: "a" (128)
|
32868
|
+
: "memory", "cc");
|
32869
|
+
}
|
32835
32870
|
@end verbatim
|
32836
32871
|
|
32837
32872
|
@subsection Related message
|
@@ -32842,7 +32877,7 @@ Under construction.
|
|
32842
32877
|
|
32843
32878
|
@subsection Since
|
32844
32879
|
|
32845
|
-
|
32880
|
+
1.8.0
|
32846
32881
|
|
32847
32882
|
@node W0833
|
32848
32883
|
@section W0833
|