File: cppcheck.sup

package info (click to toggle)
iverilog 13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,160 kB
  • sloc: cpp: 114,001; ansic: 65,058; yacc: 10,610; sh: 4,286; vhdl: 3,246; makefile: 1,884; perl: 1,813; python: 579; csh: 2
file content (381 lines) | stat: -rw-r--r-- 11,134 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
// Skip all memory issues since they should be handled by ivl_alloc.h
ctunullpointerOutOfMemory
nullPointerArithmeticOutOfMemory
nullPointerOutOfMemory
memleakOnRealloc

// We check memory allocation with valgrind
nullPointer:sys_display.c:931

// Skip asctime() obsolete for now.
asctimeCalled:sys_fst.c:381
asctimeCalled:sys_vcd.c:443

// This is not an integer overflow
integerOverflow:sys_random.c:590
integerOverflow:sys_random.c:591
integerOverflow:sys_random.c:593

// cppcheck is missing this is passed/used as part of the delay structure
unreadVariable:sys_sdf.c:269
unreadVariable:sys_sdf.c:273
unreadVariable:sys_sdf.c:343
unreadVariable:sys_sdf.c:345

// Skip since table_model() is not complete.
memleak:table_mod.c:225
memleak:table_mod.c:230
memleak:table_mod.c:243
resourceLeak:table_mod.c:607

// Skip strdup() not constant.
constVariablePointer:sys_vcd.c:631
constVariablePointer:sys_vcd.c:688

// Invalid issues.
// This always run once so v1 is assigned a value.
uninitvar:sys_random.c:267

// The interface is from the standard.
constParameterCallback:sys_convert.c:150
constParameterCallback:sys_display.c:1281
constParameterCallback:sys_display.c:1379
constParameterCallback:sys_display.c:1553
constParameterCallback:sys_display.c:2174
constParameterCallback:sys_fileio.c:261
constParameterCallback:sys_random.c:497
constParameterCallback:sys_sdf.c:437
constParameterCallback:sys_time.c:25
constParameterCallback:sys_time.c:81
constParameterCallback:table_mod.c:663

// Unused functions.
unusedFunction:sys_sdf.c:60

// The following three files are copied directly from GTKWave and we do not
// have control over them. Tony has a specific programming style so these
// problems will not be fixed.

// fstapi.c from GTKWave
asctimeCalled:fstapi.c
badBitmaskCheck:fstapi.c
constParameterPointer:fstapi.c
constVariablePointer:fstapi.c
duplicateConditionalAssign:fstapi.c
knownConditionTrueFalse:fstapi.c
memleak:fstapi.c
missingInclude:fst_win_unistd.h:50
nullPointer:fstapi.c
shiftTooManyBits:fstapi.c
shiftTooManyBitsSigned:fstapi.c
staticFunction:fstapi.c
uninitvar:fstapi.c
unreadVariable:fstapi.c
uselessAssignmentPtrArg:fstapi.c
variableScope:fstapi.c
// These functions are not used by Icarus
// fstReaderClrFacProcessMask()
unusedFunction:fstapi.c:3513
// fstReaderClrFacProcessMaskAll()
unusedFunction:fstapi.c:3533
// fstReaderGetAliasCount()
unusedFunction:fstapi.c:3578
// fstReaderGetCurrentFlatScope()
unusedFunction:fstapi.c:3392
// fstReaderGetCurrentScopeLen()
unusedFunction:fstapi.c:3465
// fstReaderGetCurrentScopeUserInfo()
unusedFunction:fstapi.c:3401
// fstReaderGetDateString()
unusedFunction:fstapi.c:3598
// fstReaderGetDoubleEndianMatchState()
unusedFunction:fstapi.c:3588
// fstReaderGetDumpActivityChangeTime()
unusedFunction:fstapi.c:3618
// fstReaderGetDumpActivityChangeValue()
unusedFunction:fstapi.c:3627
// fstReaderGetEndTime()
unusedFunction:fstapi.c:3553
// fstReaderGetFacProcessMask()
unusedFunction:fstapi.c:3486
// fstReaderGetFileType()
unusedFunction:fstapi.c:3603
// fstReaderGetFseekFailed()
unusedFunction:fstapi.c:3474
// fstReaderGetMaxHandle()
unusedFunction:fstapi.c:3573
// fstReaderGetMemoryUsedByWriter()
unusedFunction:fstapi.c:3558
// fstReaderGetNumberDumpActivityChanges()
unusedFunction:fstapi.c:3613
// fstReaderGetScopeCount()
unusedFunction:fstapi.c:3563
// fstReaderGetStartTime()
unusedFunction:fstapi.c:3548
// fstReaderGetTimescale()
unusedFunction:fstapi.c:3543
// fstReaderGetTimezero()
unusedFunction:fstapi.c:3608
// fstReaderGetValueChangeSectionCount()
unusedFunction:fstapi.c:3583
// fstReaderGetValueFromHandleAtTime()
unusedFunction:fstapi.c:5952
// fstReaderGetVarCount()
unusedFunction:fstapi.c:3568
// fstReaderGetVersionString()
unusedFunction:fstapi.c:3593
// fstReaderIterBlocks()
unusedFunction:fstapi.c:4832
// fstReaderIterBlocksSetNativeDoublesOnCallback()
unusedFunction:fstapi.c:3659
// fstReaderIterateHier()
unusedFunction:fstapi.c:3872
// fstReaderIterateHierRewind()
unusedFunction:fstapi.c:3856
// fstReaderOpen()
unusedFunction:fstapi.c:4728
// fstReaderOpenForUtilitiesOnly()
unusedFunction:fstapi.c:4721
// fstReaderPushScope()
unusedFunction:fstapi.c:3435
// fstReaderResetScope()
unusedFunction:fstapi.c:3427
// fstReaderSetFacProcessMask()
unusedFunction:fstapi.c:3500
// fstReaderSetFacProcessMaskAll()
unusedFunction:fstapi.c:3526
// fstReaderSetLimitTimeRange()
unusedFunction:fstapi.c:3636
// fstReaderSetUnlimitedTimeRange()
unusedFunction:fstapi.c:3645
// fstReaderSetVcdExtensions()
unusedFunction:fstapi.c:3652
// fstUtilityExtractEnumTableFromString()
unusedFunction:fstapi.c:6930
// fstUtilityFreeEnumTable()
unusedFunction:fstapi.c:6995
// fstWriterCreateEnumTable()
unusedFunction:fstapi.c:2715
// fstWriterCreateVar2()
unusedFunction:fstapi.c:2516
// fstWriterEmitEnumTableRef()
unusedFunction:fstapi.c:2819
// fstWriterEmitValueChangeVec32()
unusedFunction:fstapi.c:2966
// fstWriterEmitValueChangeVec64()
unusedFunction:fstapi.c:3011
// fstWriterEmitVariableLengthValueChange()
unusedFunction:fstapi.c:3057
// fstWriterGetFlushContextPending()
unusedFunction:fstapi.c:2506
// fstWriterGetFseekFailed()
unusedFunction:fstapi.c:2492
// fstWriterSetAttrEnd()
unusedFunction:fstapi.c:2707
// fstWriterSetComment()
unusedFunction:fstapi.c:2347
// fstWriterSetEnvVar()
unusedFunction:fstapi.c:2357
// fstWriterSetFileType()
unusedFunction:fstapi.c:2244
// fstWriterSetParallelMode()
unusedFunction:fstapi.c:2460
// fstWriterSetTimezero()
unusedFunction:fstapi.c:2434
// fstWriterSetValueList()
unusedFunction:fstapi.c:2352

// lxt2_write.c from GTKWave
allocaCalled:lxt2_write.c
constParameterPointer:lxt2_write.c
knownConditionTrueFalse:lxt2_write.c
shiftNegativeLHS:lxt2_write.c
staticFunction:lxt2_write.c
variableScope:lxt2_write.c
// These functions are not used by Icarus
// lxt2_wr_emit_value_int()
unusedFunction:lxt2_write.c:1611
// lxt2_wr_inc_time_by_delta()
unusedFunction:lxt2_write.c:997
// lxt2_wr_inc_time_by_delta64()
unusedFunction:lxt2_write.c:1007
// lxt2_wr_set_checkpoint_off()
unusedFunction:lxt2_write.c:835
// lxt2_wr_set_checkpoint_on()
unusedFunction:lxt2_write.c:843
// lxt2_wr_set_maxgranule()
unusedFunction:lxt2_write.c:1567
// lxt2_wr_set_partial_preference()
unusedFunction:lxt2_write.c:812
// lxt2_wr_set_timezero()
unusedFunction:lxt2_write.c:2201
// lxt2_wr_symbol_bracket_stripping()
unusedFunction:lxt2_write.c:1581
// lxt2_wr_symbol_find()
unusedFunction:lxt2_write.c:877

// lxt_write.c from GTKWave
constParameterCallback:lxt_write.c
constParameterPointer:lxt_write.c
constVariablePointer:lxt_write.c
knownConditionTrueFalse:lxt_write.c
shiftNegative:lxt_write.c:2700
shiftNegative:lxt_write.c:2744
variableScope:lxt_write.c:31
variableScope:lxt_write.c:83
variableScope:lxt_write.c:527
variableScope:lxt_write.c:528
variableScope:lxt_write.c:587
variableScope:lxt_write.c:640
variableScope:lxt_write.c:780
variableScope:lxt_write.c:880
variableScope:lxt_write.c:1056
variableScope:lxt_write.c:1057
variableScope:lxt_write.c:1058
variableScope:lxt_write.c:1194
variableScope:lxt_write.c:1850
variableScope:lxt_write.c:2029
variableScope:lxt_write.c:2030
variableScope:lxt_write.c:2147
variableScope:lxt_write.c:2148
variableScope:lxt_write.c:2265
variableScope:lxt_write.c:2266
variableScope:lxt_write.c:2595
variableScope:lxt_write.c:2596
variableScope:lxt_write.c:2597
variableScope:lxt_write.c:2598
// These functions are not used by Icarus
// lt_emit_value_int()
unusedFunction:lxt_write.c:1661
// lt_emit_value_string()
unusedFunction:lxt_write.c:2144
// lt_inc_time_by_delta()
unusedFunction:lxt_write.c:1374
// lt_inc_time_by_delta64()
unusedFunction:lxt_write.c:1384
// lt_set_chg_compress()
unusedFunction:lxt_write.c:1457
// lt_set_dict_compress()
unusedFunction:lxt_write.c:1474
// lt_set_time()
unusedFunction:lxt_write.c:1379
// lt_set_timezero()
unusedFunction:lxt_write.c:2820
// lt_symbol_bracket_stripping()
unusedFunction:lxt_write.c:1585
// lt_symbol_find()
unusedFunction:lxt_write.c:1277

// fastlz.c from GTKWave
constVariablePointer:fastlz.c
syntaxError:fastlz.c
unreadVariable:fastlz.c
// These functions are not used by Icarus
// fastlz_compress_level()
unusedFunction:fastlz.c:152
// FASTLZ_COMPRESSOR()
unusedFunction:fastlz.c:164
// FASTLZ_DECOMPRESSOR()
unusedFunction:fastlz.c:418

// lz4.c from GTKWave
bitwiseOnBoolean:lz4.c
constVariablePointer:lz4.c
staticFunction:lz4.c
syntaxError:lz4.c
unusedStructMember:lz4.c
// These functions are not used by Icarus
// LZ4_versionNumber()
unusedFunction:lz4.c:746
// LZ4_versionString()
unusedFunction:lz4.c:747
// LZ4_sizeofState()
unusedFunction:lz4.c:749
// LZ4_compress_fast_extState_fastReset()
unusedFunction:lz4.c:1411
// LZ4_compress_destSize_extState()
unusedFunction:lz4.c:1494
// LZ4_compress_destSize()
unusedFunction:lz4.c:1503
// LZ4_resetStream_fast()
unusedFunction:lz4.c:1567
// LZ4_resetStream()
unusedFunction:lz4.c:1572
// LZ4_loadDict()
unusedFunction:lz4.c:1583
// LZ4_attach_dictionary()
unusedFunction:lz4.c:1626
// LZ4_compress_forceExtDict()
unusedFunction:lz4.c:1755
// LZ4_saveDict()
unusedFunction:lz4.c:1782
// LZ4_decompress_fast_withPrefix64k()
unusedFunction:lz4.c:2456
// LZ4_createStreamDecode()
unusedFunction:lz4.c:2529
// LZ4_freeStreamDecode()
unusedFunction:lz4.c:2535
// LZ4_setStreamDecode()
unusedFunction:lz4.c:2549
// LZ4_decoderRingBufferSize()
unusedFunction:lz4.c:2575
// LZ4_decompress_safe_continue()
unusedFunction:lz4.c:2591
// LZ4_decompress_fast_continue()
unusedFunction:lz4.c:2631
// LZ4_decompress_safe_usingDict()
unusedFunction:lz4.c:2679
// LZ4_decompress_safe_partial_usingDict()
unusedFunction:lz4.c:2694
// LZ4_decompress_fast_usingDict()
unusedFunction:lz4.c:2709
// LZ4_compress_limitedOutput()
unusedFunction:lz4.c:2724
// LZ4_compress()
unusedFunction:lz4.c:2728
// LZ4_compress_limitedOutput_withState()
unusedFunction:lz4.c:2732
// LZ4_compress_withState()
unusedFunction:lz4.c:2736
// LZ4_compress_limitedOutput_continue()
unusedFunction:lz4.c:2740
// LZ4_compress_continue()
unusedFunction:lz4.c:2744
// LZ4_uncompress()
unusedFunction:lz4.c:2755
// LZ4_uncompress_unknownOutputSize()
unusedFunction:lz4.c:2759
// LZ4_sizeofStreamState()
unusedFunction:lz4.c:2766
// LZ4_resetStreamState()
unusedFunction:lz4.c:2768
// LZ4_create()
unusedFunction:lz4.c:2776
// LZ4_slideInputBuffer()
unusedFunction:lz4.c:2783

// The routines in sys_random.c are exact copies from IEEE1364-2005 and
// they have scope warnings that we need to ignore.
variableScope:sys_random.c:47
variableScope:sys_random.c:70
variableScope:sys_random.c:93
variableScope:sys_random.c:148

// Issues in Lex/Yacc files
allocaCalled:sdf_parse.c
constParameterPointer:sdf_parse.c
constVariablePointer:sdf_parse.c
knownConditionTrueFalse:sdf_parse.c
duplicateBreak:sdf_lexor.lex
duplicateBreak:sys_readmem_lex.lex
allocaCalled:table_mod_parse.c
constParameterPointer:table_mod_parse.c
constVariablePointer:table_mod_parse.c
knownConditionTrueFalse:table_mod_parse.c
duplicateBreak:table_mod_lexor.lex
constVariablePointer:<stdout>
duplicateBreak:<stdout>
nullPointer:<stdout>
redundantInitialization:<stdout>
staticFunction:<stdout>
unusedFunction:<stdout>