Commit Graph

2057 Commits

Author SHA1 Message Date
Darryl L. Miles 89fa935416 grTk1.c: GrTkIconUpdate() potential -1 out-of-bound access
SonarCloud
Access of 'char' element in the region at index -1
This was not picked up, even though similar code was.
2024-12-26 13:01:24 -05:00
Darryl L. Miles ef7f989da6 grTCairo1.c: GrTCairoIconUpdate() potential -1 out-of-bound access
SonarCloud
Access of 'char' element in the region at index -1
This was not picked up, even though similar code was.
2024-12-26 13:01:24 -05:00
Darryl L. Miles ee9d4df081 lefRead.c: LefError() add ASSERT(type) for incorrect caller usage
'type' maybe used as array index without being initialized.

Sonarcloud
Array subscript is undefined
https://sonarcloud.io/project/issues?open=AZJB17LDNGfDNup0Rjyn&id=dlmiles_magic
2024-12-26 13:01:24 -05:00
Darryl L. Miles 86b5d591d6 grOGL3.c: add GrOGLTextSize() error return
'textrect' is not filled in when GrOGLTextSize() fails.

Add error return and abort groglPutText() easrly on error.

graphics/grOGL3.c:783 Rect textrect;

SonarCloud
The right operand of '+' is a garbage value
https://sonarcloud.io/project/issues?open=AZJB160qNGfDNup0Riv5&id=dlmiles_magic
2024-12-26 13:01:24 -05:00
Darryl L. Miles 56317e6583 grOGL3.c: font, The left operand of '==' is a garbage value
SonarCloud
The left operand of '==' is a garbage value
https://sonarcloud.io/project/issues?open=AZJB160qNGfDNup0Riv4&id=dlmiles_magic
2024-12-26 13:01:24 -05:00
Darryl L. Miles 55413d6b3a grOGL1.c: GrOGLIconUpdate() potential -1 out-of-bound access
SonarCloud
Access of 'char' element in the region at index -1
https://sonarcloud.io/project/issues?open=AZJB16z6NGfDNup0Rist&id=dlmiles_magic
2024-12-26 13:01:24 -05:00
Darryl L. Miles da80d5c75d grOGL1.c: pipehandler() XEvent processing NULL deref
SonarCloud
Access to field 'w_flags' results in a dereference of a null pointer (loaded from variable 'mw')
https://sonarcloud.io/project/issues?open=AZJB16z6NGfDNup0Risq&id=dlmiles_magic
2024-12-26 13:01:24 -05:00
Darryl L. Miles 26d6af464a grDStyle.c: newres, Branch condition evaluates to a garbage value
'newres' initialization is performed the wrong side of the label
to be effective to the code that uses it.

SonarCloud
Branch condition evaluates to a garbage value
https://sonarcloud.io/project/issues?open=AZJB16zUNGfDNup0RiqG&id=dlmiles_magic
2024-12-26 13:01:24 -05:00
Darryl L. Miles 60f308826d grDStyle.c: GrLoadStyles() scount, The left operand of '<' is a garbage value
The use of 'scount' in this function looks complex, it seems to be reset to
zero sometimes and incremented at others.  Analysis shows there is a possible
path where is maybe used uninitialized.

Setting to zero seems like a good choice.

SonarCloud
grDStyle.c:514 The left operand of '<' is a garbage value
https://sonarcloud.io/project/issues?open=AZJB16zUNGfDNup0RiqE&id=dlmiles_magic
2024-12-26 13:01:24 -05:00
Darryl L. Miles bbe447423b gaStem.c: type, The left operand of '==' is a garbage value
Theoretical use of unintialized data.

Added 'default' case into switch to throw ASSERT(), otherwise
when assertions disabled treat consistently as GEO_NORTH.

SonarCloud
The left operand of '==' is a garbage value
https://sonarcloud.io/project/issues?open=AZJB17fSNGfDNup0Rkoh&id=dlmiles_magic
2024-12-26 13:01:24 -05:00
Darryl L. Miles 1e916ee361 ExtBasic.c: oppdir, The right operand of '==' is a garbage value
BD_xxxxx are a bitmask.  So it makes sense due to equality check to
set to zero so it becomes a no-op situation.

I assume lb->dir not matching one of the 4 BD_xxxxx labels would be
a data error anyway and should never occur.

SonarCloud
The right operand of '==' is a garbage value
https://sonarcloud.io/project/issues?open=AZJB16p0NGfDNup0RiW9&id=dlmiles_magic
2024-12-26 13:01:24 -05:00
Darryl L. Miles 6eff1c2132 extflat/EFname.c: EFHNBest() add argument ASSERT to convey intention
Adding ASSERT() to arguments to ensure passed arguments are non-NULL
better conveys API intent to both mitigate this false positive
but also allow analysis to inspect caller for correct usage.

SonarCloud
Null pointer passed as 1st argument to string length function
https://sonarcloud.io/project/issues?open=AZJB167jNGfDNup0RjGw&id=dlmiles_magic
2024-12-26 13:01:24 -05:00
Darryl L. Miles 6a513d01a1 EFname.c: potential dereference of a null pointer
Theoretical NULL pointer deref, assumes no iteration occurs.
Seems like false positive from incorrect caller use, from
passing suffix==NULL.

SonarCloud
Access to field 'hn_parent' results in a dereference of a null pointer (loaded from variable 'prev')
https://sonarcloud.io/project/issues?open=AZJB167jNGfDNup0RjGu&id=dlmiles_magic
2024-12-26 13:01:24 -05:00
Darryl L. Miles db85521449 EFbuild.c:1330 ASSERT(nn) added
ASSERT(nn) added to indicate programming intention.

SonarCloud
Access to field 'efnn_node' results in a dereference of a null pointer (loaded from variable 'nn')
https://sonarcloud.io/project/issues?open=AZJB168PNGfDNup0RjKF&id=dlmiles_magic
2024-12-26 13:01:24 -05:00
Darryl L. Miles fcb8bf57c6 ext2spice.c: pname used before initialization
In order for pname to be assigned a value the loop must have performed
an interation.  The order of assignment and use of 'pname' is not the
natural order you'd expect.  It also looks like the TxPrint message
may display the incorrect port name from the previous loop iteration.

The code block looks like the resolution of 'pname' has no side-effects.
So should be done first so the correct port name is output in the log message.

SonarCloud
2nd function call argument is an uninitialized value
https://sonarcloud.io/project/issues?open=AZJB17lqNGfDNup0Rk6f&id=dlmiles_magic
2024-12-26 13:01:24 -05:00
Darryl L. Miles 97913ab08c calma/CalmaWrite.c: calmaProcessBoundaryZ() Dereference of null pointer
Theoretical NULL pointer deref.  Seems like false positive as a
BOUNDARY record does not make sense with no points.

This guards against a potential crash from a bad data model.

SonarCloud
Dereference of null pointer
https://sonarcloud.io/project/issues?open=AZJB17hwNGfDNup0Rkub&id=dlmiles_magic
2024-12-26 13:01:24 -05:00
Darryl L. Miles dd6bb9baf4 calma/CalmaWrite.c: calmaProcessBoundary() Dereference of null pointer
Theoretical NULL pointer deref.  Seems like false positive as a
BOUNDARY record does not make sense with no points.

This guards against a potential crash from a bad data model.

SonarCloud
Dereference of null pointer
https://sonarcloud.io/project/issues?open=AZJB17hXNGfDNup0Rktk&id=dlmiles_magic
2024-12-26 13:01:24 -05:00
Darryl L. Miles a3a40bee73 main-macos.yml add Prepare archive and Upload archive steps 2024-12-26 12:52:26 -05:00
Darryl L. Miles ecba1b38d2 main-macos.yml add Summary step 2024-12-26 12:52:26 -05:00
Darryl L. Miles fa07bd0067 main-macos.yml log output extract CONFIGURE_ARGS 2024-12-26 12:52:25 -05:00
Darryl L. Miles be2f8f9a19 main-macos.yml install libglu freeglut on x86_64 2024-12-26 12:52:25 -05:00
Darryl L. Miles f1acfee34a MacOSX diagnostics Search 2024-12-26 12:52:25 -05:00
Darryl L. Miles 90b61caff0 GHA: main.yml move MacOSX to its own workflow 2024-12-26 12:52:25 -05:00
Darryl L. Miles e54111cf6f configure.in: X11 detection and option order
The -L option needs to be placed before the -l it needs to affect.
This maybe important on MacOSX where a nonstandard/optional package
provides X11 support so the locations are not in system locations.
2024-12-26 12:52:25 -05:00
Darryl L. Miles 3f1344570c MacOSX diagnostics Kick The Tyres 2024-12-26 12:52:25 -05:00
Darryl L. Miles dc79b14739 scripts/configure_mac --x-includes=... --x-libraries=... 2024-12-26 12:52:25 -05:00
Darryl L. Miles bfc82e43db MacOS: FREAD rename to magicFREAD due to sys/fcntl.h definition
Example build issue using MacOS 12 (Xcode 14.2 from MacOSX.platform).

In file included from grTk1.c:23:
In file included from ../utils/main.h:26:
In file included from ../windows/windows.h:26:
../utils/magic.h:143:13: warning: 'FREAD' macro redefined [-Wmacro-redefined]
    #define FREAD(a,b,c,d)    gzread(d,a,b*c)
            ^
/Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/fcntl.h:110:9: note: previous definition is here
 #define FREAD           0x00000001
2024-12-26 12:52:25 -05:00
Darryl L. Miles 48f8707753 GHA: main-macos.yml 2024-12-26 12:52:25 -05:00
Carsten Wulff 772bfe2f71 commands/CmdFI.c: added CmdFlush_NoConfirm option to disable flush prompt 2024-12-26 12:49:33 -05:00
Darryl L. Miles d79533a255 K&R calma: move internal prototypes and typedef to calmaInt.h
K&R obsolete syntax removal for C23 compatibility series
2024-12-26 12:44:50 -05:00
Darryl L. Miles d92e2b70b6 K&R CalmaWrite.c: move typedef to before forward declaration usage
K&R obsolete syntax removal for C23 compatibility series
2024-12-26 12:44:50 -05:00
Darryl L. Miles 5f55ab825a K&R CalmaWriteZ.c: move typedef to before forward declaration
K&R obsolete syntax removal for C23 compatibility series
2024-12-26 12:44:50 -05:00
Darryl L. Miles 979c810c38 K&R calma: missing HAVE_ZLIB ifdef around function using type gzFile
K&R obsolete syntax removal for C23 compatibility series
2024-12-26 12:44:50 -05:00
Darryl L. Miles 603ce8b887 K&R CalmaRead.c: too many args for calmaLookCell()
K&R obsolete syntax removal for C23 compatibility series
2024-12-26 12:44:50 -05:00
Darryl L. Miles a9ea08a597 K&R calma/*.c: bulk function implementation conversion
K&R obsolete syntax removal for C23 compatibility series
2024-12-26 12:44:50 -05:00
Darryl L. Miles f3ace65a78 K&R calma/*.c: bulk forward reference function prototype conversion
K&R obsolete syntax removal for C23 compatibility series
2024-12-26 12:44:50 -05:00
Darryl L. Miles 7696f673df configure: autoconf regen (2.69) to add HAVE_SYS_TIME_H 2024-12-26 12:44:50 -05:00
Darryl L. Miles cd63fa3c14 K&R calma: remove system header time() K&R style prototype
time.h has existed since C89 so is a standard header expected
to always be available.

sys/time.h was an optional header that historically only some
platforms provided.

If there is a conflict on specific platforms it is better to
'#if !defined()' that specific niche platform with the problem
if both headers are included in the same compile unit.  But I
don't think this is a problem in modern times.

So this results in a resolution that removes #ifdef around
time.h and the detection by configure for the availabiltiy
of sys/time.h.

K&R obsolete syntax removal for C23 compatibility series
2024-12-26 12:44:50 -05:00
Darryl L. Miles 3f4eb4120e K&R calma: prototype for non-existent function: calmaMergeBoundaries()
Remove forward declaration prototype to correct error.

K&R obsolete syntax removal for C23 compatibility series
2024-12-26 12:44:50 -05:00
Darryl L. Miles f0b6231017 K&R calma: prototype for non-existent function: calmaWriteMarkFunc()
Remove forward declaration prototype to correct error.

K&R obsolete syntax removal for C23 compatibility series
2024-12-26 12:44:50 -05:00
Darryl L. Miles 1fdd8bc185 K&R calmaInt.h: conversion to ANSI
K&R obsolete syntax removal for C23 compatibility series
2024-12-26 12:44:50 -05:00
Darryl L. Miles 40b317979d K&R calma.h: conversion to ANSI
K&R obsolete syntax removal for C23 compatibility series
2024-12-26 12:44:50 -05:00
Darryl L. Miles 5ee3b180d3 K&R calma: missing prototype: calmaWriteContacts()
Rename existing prototype method name to correct error.

K&R obsolete syntax removal for C23 compatibility series
2024-12-26 12:44:50 -05:00
Tim Edwards 48abe30ea4 Implemented a new CIF/GDS generation operator option for
"bloat-all" which is "bloat-all types1 types2 distance" where the
"distance" value is a maximum amount to grow.  It is not (that I
know of) particularly useful for generating output GDS, but it is
very useful for generating temporary layers for DRC checks,
especially things like determining tap distance for latch-up
rules.  The alternative (used in the sky130 tech file) is a
tedious step-by-step "grow" followed by "and-not".  This rule
option is much cleaner to implement and computes faster (although
it is still a boolean operator and is much slower than an edge
rule).
2024-12-25 20:46:25 -05:00
Tim Edwards 89b6f4f92b Corrected an error with the bloat-all CIF operator in which
bloat-all would fail to operate from the top layer of a contact
type due to the use of DBplane(type) instead of counting all
planes of the contact.
2024-12-16 21:52:11 -05:00
Tim Edwards 5ebbed4c12 Corrected the run-length wide-spacing rule so that it correctly
identifies areas which meet the proper definition of run-length
(both edges are parallel for the run-length distance or more).
Previously, errors were getting triggered for geometry where
only one edge exceeded the run-length distance.
2024-12-12 14:10:03 -05:00
Tim Edwards 37dfe07edf Extended the "cifmaxwidth" function to include the option "both",
which has the same meaning as the "maxwidth" function ("both"
checks either tile dimension to see if it exceeds the maximum).
This is a simple per-tile check and assumes that violations do
not occur across multiple tiles.  This should be sufficient for
most checks.
2024-12-08 12:14:38 -05:00
Tim Edwards dc87a8c693 Corrected two errors with the wiring tool: (1) Ignore
"angles"-type width rules when calculating the default metal
width DRC rule (this width when present will always be
larger than the minimum metal width), and (2) If an exiting
wire is larger than the contact size, then set the contact
size such that the contact PLUS the surrounding metal is the
width of the exiting wire.  The existing code sets the
contact size itself to the width of the exiting wire, such
that when surrounding material is added, the contact is
larger than it needs to be.  The fix to (1) will also fix
other places where the default DRC width rule is computed,
which includes LEF and DEF handling and computing rendered
text sizes when reading GDS.
2024-12-06 21:45:02 -05:00
Tim Edwards e0c95d6d78 Additional coding to handle discovery of terminal types on
different planes of a device that are connected to a multi-tile
device.  This is a more general solution than previously coded,
in which only the first tile of a device would be searched for
terminals on other planes, which was only guaranteed to work
if the device was represented by a single tile.
2024-12-06 20:51:59 -05:00
Tim Edwards 0a67151292 Extended the device parameters to allow a terminal width that is
different from the device (i.e., gate) width, for devices that do
not define a MOS-like gate spanning the width of the device.  This
is restricted to the assumption that the terminal is rectangular
and therefore a simple width and length can be derived from the
area and perimeter.  Also, length is defined as the smaller
dimension and width as the larger dimension.  For additional
restrictions, see the updated documentation.  This was added to
allow correct width and length extraction of a bipolar emitter
window, but may be more generally useful.
2024-12-06 16:42:43 -05:00