Commit Graph

2057 Commits

Author SHA1 Message Date
Darryl L. Miles 518b5f45d8 bpEnum.h: warning: suggest parentheses around assignment used as truth value
Removes 1312 warning lines from build output due to inline nature of use.

bplane/bpEnum.h:509:10: warning: suggest parentheses around assignment used as truth value
bplane/bpEnum.h:513:10: warning: suggest parentheses around assignment used as truth value
bplane/bpEnum.h:517:10: warning: suggest parentheses around assignment used as truth value
bplane/bpEnum.h:521:10: warning: suggest parentheses around assignment used as truth value
bbplane/bpEnum.h:525:10: 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 d94cd72538 37 x warning: array subscript has type 'char'
Compiler is expressing range concern with the warning mitigated by using
unsigned C array offsets.  This also draws attention to the range concern
when reading the code and making changes.

DBundo.c:263:45: warning: array subscript has type 'char'
DBundo.c:279:49: warning: array subscript has type 'char'
DBundo.c:317:52: warning: array subscript has type 'char'
DBundo.c:318:64: warning: array subscript has type 'char'
DBundo.c:324:52: warning: array subscript has type 'char'
DBundo.c:325:64: warning: array subscript has type 'char'
DBundo.c:329:50: warning: array subscript has type 'char'
DBundo.c:330:58: warning: array subscript has type 'char'
DBundo.c:338:52: warning: array subscript has type 'char'
DBundo.c:339:64: warning: array subscript has type 'char'
DBundo.c:345:52: warning: array subscript has type 'char'
DBundo.c:346:64: warning: array subscript has type 'char'
DBundo.c:350:50: warning: array subscript has type 'char'
DBundo.c:351:58: warning: array subscript has type 'char'
DBundo.c:371:52: warning: array subscript has type 'char'
DBundo.c:372:64: warning: array subscript has type 'char'
DBundo.c:378:52: warning: array subscript has type 'char'
DBundo.c:379:64: warning: array subscript has type 'char'
DBundo.c:383:50: warning: array subscript has type 'char'
DBundo.c:384:58: warning: array subscript has type 'char'
DBundo.c:392:52: warning: array subscript has type 'char'
DBundo.c:393:57: warning: array subscript has type 'char'
DBundo.c:399:52: warning: array subscript has type 'char'
DBundo.c:400:57: warning: array subscript has type 'char'
DBundo.c:403:53: warning: array subscript has type 'char'
DBundo.c:407:50: warning: array subscript has type 'char'
DBundo.c:408:58: warning: array subscript has type 'char'
EFbuild.c:1048:32: warning: array subscript has type 'char'
EFbuild.c:1056:32: warning: array subscript has type 'char'
ExtBasic.c:2358:43: warning: array subscript has type 'char'
ExtBasic.c:2493:43: warning: array subscript has type 'char'
ExtBasic.c:2519:43: warning: array subscript has type 'char'
ExtBasic.c:2644:43: warning: array subscript has type 'char'
ExtBasic.c:2678:43: warning: array subscript has type 'char'
ResPrint.c:143:43: warning: array subscript has type 'char'
plotRutils.c:713:34: warning: array subscript has type 'char'
plotRutils.c:786:29: warning: array subscript has type 'char'

GCC14 -Wall cleanup series [-Wchar-subscripts]
2024-10-09 21:12:55 -04:00
Darryl L. Miles 9225fa6cf1 4 x warning: suggest explicit braces to avoid ambiguous 'else'
Give compiler the extra braces it recommends.

DBio.c edited as my original change was caught out by the incorrect
indention of the 'else' keyword and my modification would have caused a
NULL deref.   Exactly the kind of issue this warning is trying to prevent.

CmdTZ.c:417:20: warning: suggest explicit braces to avoid ambiguous 'else'
DBio.c:1422:12: warning: suggest explicit braces to avoid ambiguous 'else'
DBpaint2.c:285:12: warning: suggest explicit braces to avoid ambiguous 'else'
DBpaint2.c:384:12: warning: suggest explicit braces to avoid ambiguous 'else'

GCC14 -Wall cleanup series [-Wdangling-else]
2024-10-09 21:12:55 -04:00
Darryl L. Miles 7dfdf5aa63 CIFrdcl.c: warning: comparison between two arrays
Added pointer casts to hint to compiler the programmer intention
is to compare as pointers to the start of the array (and not be
concerned the programmer is overlooking the contents of the array).

GCC14 -Wall cleanup series [-Warray-compare]
2024-10-09 21:12:55 -04:00
Darryl L. Miles b654647fdc PlowTest.c: warning: enumeration value 'PC_ERROR' not handled in switch
False positive.

Added no-op case statement, but code above looks the case should never
execute due return from function.

GCC14 -Wall cleanup series [-Wswitch]
2024-10-09 21:12:55 -04:00
Darryl L. Miles bd75ddf32c mzMain.c: warning: this 'else' clause does not guard...
Use of macro idiom: if(1) { ... } else
  which has dangling else keyword to allow trailing semicolon at
  use site, is not a good pattern.

Replaced with idiom: do { ... } while(0)
  which should achieve the same purpose but now cause compile
  error when used incorrectly at use site.

GCC14 -Wall cleanup series [-Wmisleading-indentation]
2024-10-09 21:12:55 -04:00
Darryl L. Miles 88d36bfd1e geofast.h: warning: this 'else' clause does not guard...
Use of macro idiom: if(1) { ... } else
  which has dangling else keyword to allow trailing semicolon at
  use site, is not a good pattern.

Replaced with idiom: do { ... } while(0)
  which should achieve the same purpose but now cause compile
  error when used incorrectly at use site.

GCC14 -Wall cleanup series [-Wmisleading-indentation]
2024-10-09 21:12:55 -04:00
Darryl L. Miles e8f9b0af5e CIFgen.c: warning: this 'for' clause does not guard...
return keyword indention corrected
braces added to previous statement to better convey code
 intention of multiline statement

GCC14 -Wall cleanup series [-Wmisleading-indentation]
2024-10-09 21:12:55 -04:00
Darryl L. Miles 0cde303563 ResReadSim.c: warning: this 'if' clause does not guard...
break keyword indention corrected, braces added to better
convey code intention of multiline statement.

GCC14 -Wall cleanup series [-Wmisleading-indentation]
2024-10-09 21:12:55 -04:00
Darryl L. Miles 967b41343b GCC14: warning: missing braces around initializer
GCC14 -Wall cleanup series [-Wmissing-braces]
2024-10-09 21:12:55 -04:00
Darryl L. Miles 3300f45a22 DRCtech.c: warning: use of logical '&&' with constant operand
Looks like logic error hiding behind warning

DRCtech.c:4365:22: warning: use of logical '&&' with constant
 operand [-Wconstant-logical-operand]
DRCtech.c:4365:22: note: remove constant to silence this warning

clang18 default warning cleanup
2024-10-09 20:50:00 -04:00
Darryl L. Miles da2c7b719e DRCsubcell.c: fix: warning: value computed is not used
Looks like a logic bug hidden in the warning.

GCC14 -Wall cleanup series [-Wunused-value]
2024-10-09 20:50:00 -04:00
Darryl L. Miles 3477480ab0 NMbutton.c: fix: warning: statement with no effect
Looks like a logic bug hidden in the warning.

GCC14 -Wall cleanup series [-Wunused-value]
2024-10-09 20:50:00 -04:00
Darryl L. Miles c749d01eb7 rtrStem.c: fix: warning: statement with no effect
Looks like a logic bug hidden in the warning.

GCC14 -Wall cleanup series [-Wunused-value]
2024-10-09 20:50:00 -04:00
Darryl L. Miles cebb1a5277 lefTech.c: fix: default value logic error
Looks like a logic bug, hiding behind this compiler warning

lefTech.c:507:21: warning: suggest parentheses around assignment used as truth value
lefTech.c:509:21: warning: suggest parentheses around assignment used as truth value

GCC14 -Wall cleanup series [-Wparentheses]
2024-10-09 20:50:00 -04:00
Darryl L. Miles 4ea0f6a9b7 DBcellcopy.c: fix warning: self-comparison always evaluates to false
Looks like a straighforward logic bug from a recent (2023) change.

GCC14 -Wall cleanup series [-Wtautological-compare]
2024-10-09 20:50:00 -04:00
Darryl L. Miles 015f03307a appimage/Dockerfile: fix CentOS7 based docker build due to EOL
CentOS7 went EOL on June 30, 2024 this builds out of vault.centos.org
2024-10-09 20:40:28 -04:00
Darryl L. Miles 65a0dc45dc graphics: windowname[] potential buffer overrun warning
GCC14 loud default warnings series
2024-10-09 20:39:12 -04:00
Darryl L. Miles 63256f1a44 DBio.c: resolve warnings and use snprintf()
GCC14 loud default warnings series [-Wformat-overflow=]
2024-10-09 20:39:12 -04:00
Darryl L. Miles 1c326c9141 grouteCrss.c: '%s' directive writing up to 1023 bytes into a region of size 227
GCC14 loud default warnings series [-Wformat-overflow=]
2024-10-09 20:39:12 -04:00
Darryl L. Miles 6a08b31149 defWrite.: '%.10g' directive writing between 1 and 17 bytes into a region of size 12
GCC14 loud default warnings series [-Wformat-overflow=]
2024-10-09 20:39:12 -04:00
Darryl L. Miles 9f88450243 niceabort.c: '%s' directive writing up to 199 bytes into a region of size 177
GCC14 loud default warnings series [-Wformat-overflow=]
2024-10-09 20:39:12 -04:00
Darryl L. Miles 29bd23d40b txOutput.c:408: warning: missing sentinel in function call
GCC false positive, seems pedantic over it being NULL not 0.

GCC14 loud default warnings series [-Wformat=]
2024-10-09 20:39:12 -04:00
Darryl L. Miles bf916d2647 SimRsim.c: directive writing 1 byte into a region of size between 0 and 255
GCC14 loud default warnings series [-Wformat-overflow=]
2024-10-09 20:39:12 -04:00
Darryl L. Miles b81e04eed4 ResPrint.c: '%s' directive writing 2 bytes into a region of size between 1 and 1000
GCC14 loud default warnings series [-Wformat-overflow=]
2024-10-09 20:39:12 -04:00
Darryl L. Miles 41913fbd78 ExtUnique.c: '_uq' directive writing 3 bytes into a region of size between 1 and 1024
GCC14 loud default warnings series [-Wformat-overflow=]
2024-10-09 20:39:12 -04:00
Darryl L. Miles 66734bbaee ExtHier.c: format '%ld' expects argument of type 'long int', but .. 'dlong'
GCC14 loud default warnings series
2024-10-09 20:39:12 -04:00
Darryl L. Miles b3cb528e46 ExtBasic.c: comparison between pointer and integer
GCC14 loud default warnings series
2024-10-09 20:39:12 -04:00
Darryl L. Miles 1ae4518846 DLONG_PREFIX is %ld on x86_64 LP64
GCC14 loud default warnings fix
2024-10-09 20:39:12 -04:00
Darryl L. Miles 32a7323287 SimSelect.c: type defaults to 'int' in declaration of 'RsimErrorMsg'
GCC14 --without-tk --without-tcl
Related issue: https://github.com/RTimothyEdwards/magic/issues/323
2024-10-09 20:35:19 -04:00
Darryl L. Miles 932deeaf2d readline: define _XOPEN_SOURCE at the top of files
It is a requirement to define feature_test_macros(7) as soon as possible
before including any files, otherwise the headers may not allow further
configuration, as reconfiguration maybe denied.  You need to pick the
standard you wish to work with for the compilation unit (the file).

This can be seen with an error for lack of symbol `wcwidth()` from wchar.h

Moving the order slightly fixes the compile failure issue.
See feature_test_macros(7) for more info.

GCC14 --without-tk --without-tcl (without system libreadline-dev)
2024-10-09 20:35:19 -04:00
Darryl L. Miles 54f49829f2 graphics: multiple definition of `various_x11_symbols'
Solution is to make the grX11thread.c and grX11su1[5].c versions
the official location.  Another solution maybe to split them into
their own file grX11common.c that would be shared.

Multiple configurations tested, tested configurations assume X11
is available.  The configuration wording indicates X11 must be
available for all graphics enabled build configurations.

Affected symbols appear to have multiple definitions:
grCursors
grXdpy
grXscrn
pipeRead
pipeWrite
Xhelper
grVisual

GCC14 and linker will not link the final executable due to this.

GCC14 --without-tk --without-tcl
Related issue: https://github.com/RTimothyEdwards/magic/issues/323
2024-10-09 20:35:19 -04:00
Darryl L. Miles e5c3e703c3 HashLookOnly(): passing argument 2 of 'HashLookOnly' makes pointer from integer without a cast
Also HashFind()

GCC14 --without-tk --without-tcl
Related issue: https://github.com/RTimothyEdwards/magic/issues/323
2024-10-09 20:35:19 -04:00
Darryl L. Miles c90bde4961 DBWelement.c: passing argument 1 of 'TxPrintf' from incompatible pointer type
GCC14 --without-tk --without-tcl
Related issue: https://github.com/RTimothyEdwards/magic/issues/323
2024-10-09 20:35:19 -04:00
Darryl L. Miles 23930909b1 database/DBio.c: error: assignment to 'char *' from 'ClientData'
GCC14 --without-tk --without-tcl
Related issue: https://github.com/RTimothyEdwards/magic/issues/323
2024-10-09 20:35:19 -04:00
Darryl L. Miles 8994a68e61 DBPropGet(): error: assignment to 'char *' from 'ClientData'
GCC14 --without-tk --without-tcl
Related issue: https://github.com/RTimothyEdwards/magic/issues/323
2024-10-09 20:35:19 -04:00
Darryl L. Miles 0a4e2a5a27 HashGetValue: warning: comparison between pointer and integer
GCC14 --without-tk --without-tcl
Related issue: https://github.com/RTimothyEdwards/magic/issues/323
2024-10-09 20:35:19 -04:00
Tim Edwards de5c54e20b Added a missing description of the "flatten" property, which is
documented briefly in the "flatten" command reference page, but
no in the "property" command reference page.
2024-10-09 20:34:08 -04:00
Tim Edwards a3b61abe2b Corrected an error in which "extract unique noports" and
"extract unique notopports" both fail to work correctly because
an attempt some time ago to avoid issuing warnings about shorted
port names when using those options was changed in the wrong
line.
2024-10-07 11:48:27 -04:00
Tim Edwards 6162a9f459 Corrected the "bloat-all" function so that it behaves properly on
angled edges.  This is a rare case and so has never come up before,
but can happen especially on transistors with gate or diffusion
with 45 degree chamfers or flanges.  Thanks to Mark Martin for
providing the use case.
2024-10-03 20:37:43 -04:00
Darryl L. Miles 80f051f79d GHA: CI WASM build use --disable-compression
I assume it can't link to libz anyway, you'd need to rebuild libz
for WASM target (or use a the Web API for GZIP).
2024-10-01 21:18:55 -04:00
Darryl L. Miles 7589bdba10 GHA: BUMP actions/upload-artifact@v4 (from v3) 2024-10-01 21:18:55 -04:00
Darryl L. Miles 08affbe032 GHA: BUMP actions/checkout@v4 (from v2) 2024-10-01 21:18:55 -04:00
Darryl L. Miles a467154fec Update appimage.yml (rename job) 2024-10-01 21:18:55 -04:00
Tim Edwards e2c3eb3e20 Corrected the previous commit, which did not fix the problem that
it claimed to fix, but caused an incorrect DRC maxwidth check
instead.  The problem appears to be correctly resolved now.
Also:  Tracked down a recently-introduced minor issue in which
the interactive DRC stops running after issuing "drc check" and
does not resume until another key or mouse even occurs.  This
turned out to be caused by the work on the "logcommands" command,
which should have used "*bypass" before "logcommands suspend"
and "logcommands resume", since the "*bypass" indicates that
the command has no impact on layout and should not interrupt
the DRC checker.
2024-10-01 21:14:12 -04:00
Tim Edwards 3e0ad4ff58 Finally got around to restoring the behavior of the toolbar with
respect to using the 3rd mouse button to hide a layer, and
indicating the layer is hidden by blanking the icon (which works
better with the new scrollable icon list, but got broken by the
same).  Also:  Added a previously missing behavior, which is to
correctly update the icon settings based on using the command
"see" and "see no" with layer aliases (e.g., "allm1").
2024-10-01 16:01:28 -04:00
Tim Edwards dba6f99d93 Updated the revision number to go along with the merge of pull
request #325 from Daryl Miles.  Made a few simple style changes
to conform to (what is vaguely defined as) the overall programming
style for magic (passed down from John Ousterhout).
2024-10-01 12:56:31 -04:00
Darryl L. Miles e119188f23 fix: findUse can return NULL crash
The main cause of the crash was the path for UNDO_CELL_PLACE this was
trigged by performing a number of cell create/move operations (unknown
exactly what sequence).  Then a large number of "undo" operations.

There is an ASSERT in findUse() but that does not seem built into the
release (or debug CFLAGS=-g3) builds.
2024-10-01 12:43:27 -04:00
Darryl L. Miles 3638d382d6 fix: lef write crash (when cells with labels in space pNum==-1)
The issue here is can pNum==-1 which causes a crash.
2024-10-01 12:43:27 -04:00
Darryl L. Miles 18a4dddc2b fix: read of uninitialized data at inChar[0]
This is a defensive fix, might cause unexpected program exit if triggered.
The loop will iterate at least once when nbytes==0, but this value
indicates XLookupString did not fill in any data, so the entire buffer
is undefined.

Using memset() before or inChar[0]=0 after XLookupString did not fix
the issue.  Using inChar[0]=0 immediately before the loop did fix as
well.  But this patch seems to be the best approach.
2024-10-01 12:43:27 -04:00