Commit Graph

16 Commits

Author SHA1 Message Date
Darryl L. Miles 6afadf9809 gcc11 -Wall -Wpedantic cleanup (post __attribute__) 2025-01-06 16:25:38 +00:00
Darryl L. Miles 07f9bbe1fb gcc11 -Wall -Wpedantic cleanup 2025-01-06 16:12:11 +00:00
Darryl L. Miles 3dbcb0759e Lookup() constify call-site
plow/PlowCmd.c: Lookup() constify call-site
plot/plotVers.c: Lookup() constify call-site
plot/plotMain.c: Lookup() constify call-site
plot/plotCmd.c: Lookup() constify call-site
netmenu/NMnetlist.c: Lookup() constify call-site
netmenu/NMcmdLZ.c: Lookup() constify call-site
netmenu/NMcmdAK.c: Lookup() constify call-site
lef/lefTech.c: Lookup() constify call-site
lef/lefCmd.c: Lookup() constify call-site
irouter/irRoute.c: Lookup() constify call-site
irouter/irCommand.c: Lookup() constify call-site
router/rtrCmd.c: Lookup() constify call-site
resis/ResRex.c: Lookup() constify call-site
gcr/gcrShwFlgs.c: Lookup() constify call-site
windows/windCmdSZ.c: Lookup() constify call-site
2024-12-26 15:20:58 -05:00
Darryl L. Miles be09edb8d8 12 x warning: suggest parentheses around '&&' within '||'
The '&' has higher precedence, so the expression of the '&' side receive
extra parentheses.

ResMakeRes.c:671:37: warning: suggest parentheses around '&&' within '||'
ResMakeRes.c:942:32: warning: suggest parentheses around '&&' within '||'
ResSimple.c:201:70: warning: suggest parentheses around '&&' within '||'
ResRex.c:1036:28: warning: suggest parentheses around '&&' within '||'
ResRex.c:1038:50: warning: suggest parentheses around '&&' within '||'
ext2sim.c:1341:47: warning: suggest parentheses around '&&' within '||'
ext2spice.c:172:44: warning: suggest parentheses around '&&' within '||'
ext2spice.c:173:49: warning: suggest parentheses around '&&' within '||'
ext2spice.c:3655:50: warning: suggest parentheses around '&&' within '||'
ext2hier.c:1412:50: warning: suggest parentheses around '&&' within '||'
gcrDebug.c:638:55: warning: suggest parentheses around '&&' within '||'
selEnum.c:323:28: warning: suggest parentheses around '&&' within '||'

GCC14 -Wall cleanup series [-Wparentheses]
2024-10-09 21:12:55 -04:00
Darryl L. Miles 4bfed56924 17 x warning: suggest parentheses around assignment used as truth value
gaStem.c:225:9: warning: suggest parentheses around assignment used as truth value
gaStem.c:350:9: warning: suggest parentheses around assignment used as truth value
grouteMain.c:363:12: warning: suggest parentheses around assignment used as truth value
grouteMaze.c:573:17: warning: suggest parentheses around assignment used as truth value
groutePath.c:127:13: warning: suggest parentheses around assignment used as truth value
irCommand.c:901:12: warning: suggest parentheses around assignment used as truth value
irCommand.c:999:12: warning: suggest parentheses around assignment used as truth value
irCommand.c:1275:13: warning: suggest parentheses around assignment used as truth value
irCommand.c:1375:13: warning: suggest parentheses around assignment used as truth value
irCommand.c:1931:17: warning: suggest parentheses around assignment used as truth value
rtrDcmpose.c:435:12: warning: suggest parentheses around assignment used as truth value
rtrPin.c:174:17: warning: suggest parentheses around assignment used as truth value
rtrStem.c:373:21: warning: suggest parentheses around assignment used as truth value
rtrStem.c:479:9: warning: suggest parentheses around assignment used as truth value
rtrStem.c:952:17: warning: suggest parentheses around assignment used as truth value
gcrInit.c:239:9: warning: suggest parentheses around assignment used as truth value
net2ir.c:123:13: warning: suggest parentheses around assignment used as truth value

GCC14 -Wall cleanup series [-Wparentheses]
2024-10-09 21:12:55 -04:00
Darryl L. Miles 8b2efd5d7d gcr/gcrDebug.c Opened stream never closed. Potential resource leak
A false positive in practice, made clearer by using a 2nd variable
with attention drawing name.

SonarCloud
gcr/gcrDebug.c:429 Opened stream never closed. Potential resource leak
https://sonarcloud.io/project/issues?open=AZJB17OzNGfDNup0Rj-t&id=dlmiles_magic
2024-10-01 12:36:13 -04:00
Darryl L. Miles a0aea2aa2e gcr/gcrDebug.c Add a field width specifier to this "%s" placeholder.
Unbounded local buffer used in fscanf() string extraction call.
Add width to specified to ensure truncation as 24 character instead
of buffer overflow.

SonarCloud https://sonarcloud.io/project/issues?open=AZJB17OzNGfDNup0Rj9x&id=dlmiles_magic
2024-10-01 12:36:13 -04:00
Darryl Miles 4ddd0624cb gcr/gcrDebug.c: Wrong type of arguments to formatting function
Fix code scanning alert no. 97: Wrong type of arguments to formatting function (#41)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:13 -04:00
Darryl L. Miles fc20977fa5 gcr/gcrDebug.c: (intmax_t) %ld Wrong type of arguments to formatting function
Mutiple items per line.

CodeQL: https://github.com/dlmiles/magic/security/code-scanning/87
2024-10-01 12:36:13 -04:00
Darryl Miles 96c7e283c0 gcr/gcrDebug.c: Incorrect return-value check for a 'scanf'-like function
Fix code scanning alert no. 137: Incorrect return-value check for a 'scanf'-like function (#9)

* Create codeql.yml

* Fix code scanning alert no. 137: Incorrect return-value check for a 'scanf'-like function

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:12 -04:00
Darryl Miles fed93c200d gcr/gcrShwFlgs.c: Likely overrunning write
Fix code scanning alert no. 2: Likely overrunning write (#5)

* Fix code scanning alert no. 2: Likely overrunning write

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Update gcrShwFlgs.c

* AI added snprintf(), DLM increased buffer for enough space for rounded/aligned 64bit %p

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-01 12:36:12 -04:00
Alessandro De Laurenzis b306a39560 Compatibility with C99 standard
This commit makes the code (mostly) C99-compatible, enabling to compile
it without the -Wno-error=implicit-function-declaration flag. This
way, Magic becomes usable on arm64 architectures, specifically on Apple
computers with M1/M2 SoC.
2022-10-29 06:07:46 +02:00
Ryan Schmidt 4c4b0e301b Resolve -Wcomment warnings
Resolve -Wcomment warnings like:

./cifin-cmos14b.gen:2:1: warning: '/*' within block comment [-Wcomment]
2022-04-13 08:33:45 -04:00
Tim Edwards 2af38a4191 Updates from running the fix-ending-whitespace script. 2020-05-23 17:13:14 -04:00
Tim Edwards 80fa495103 Removed the Depend files, which were being tracked with .gitignore
pointing to Depend instead of */Depend.
2020-03-13 15:39:08 -04:00
Tim Edwards 231a299b16 Initial commit at Tue Apr 25 08:41:48 EDT 2017 by tim on stravinsky 2017-04-25 08:41:48 -04:00