Bug Summary

File:src/showexports.c
Warning:line 85, column 2
Value stored to 'syme' is never read

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-unknown-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name showexports.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/home/kfp/aldor/aldor/aldor/src -fcoverage-compilation-dir=/home/kfp/aldor/aldor/aldor/src -resource-dir /usr/local/lib/clang/18 -D PACKAGE_NAME="aldor" -D PACKAGE_TARNAME="aldor" -D PACKAGE_VERSION="1.4.0" -D PACKAGE_STRING="aldor 1.4.0" -D PACKAGE_BUGREPORT="aldor@xinutec.org" -D PACKAGE_URL="" -D PACKAGE="aldor" -D VERSION="1.4.0" -D YYTEXT_POINTER=1 -D HAVE_STDIO_H=1 -D HAVE_STDLIB_H=1 -D HAVE_STRING_H=1 -D HAVE_INTTYPES_H=1 -D HAVE_STDINT_H=1 -D HAVE_STRINGS_H=1 -D HAVE_SYS_STAT_H=1 -D HAVE_SYS_TYPES_H=1 -D HAVE_UNISTD_H=1 -D STDC_HEADERS=1 -D HAVE_LIBREADLINE=1 -D HAVE_READLINE_READLINE_H=1 -D HAVE_READLINE_HISTORY=1 -D HAVE_READLINE_HISTORY_H=1 -D USE_GLOOP_SHELL=1 -D GENERATOR_COROUTINES=0 -D HAVE_DLFCN_H=1 -D LT_OBJDIR=".libs/" -I . -D VCSVERSION="2c53e759f1e00e345f8b172e7139debda72fda13" -internal-isystem /usr/local/lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/14/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O0 -Wno-empty-body -Wno-enum-compare -Wno-missing-field-initializers -Wno-unused -Wno-unused-parameter -Wno-error=format -Wno-error=type-limits -Wno-error=strict-aliasing -Wno-sign-compare -Wno-error=shift-negative-value -Wno-error=clobbered -std=c99 -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/scan-build-2026-01-15-223856-845667-1 -x c showexports.c
1#include <stdlib.h>
2
3#include "axlobs.h"
4#include "absyn.h"
5#include "token.h"
6#include "stab.h"
7#include "tform.h"
8#include "tqual.h"
9#include "tinfer.h"
10#include "srcpos.h"
11#include "srcline.h"
12#include "scan.h"
13#include "linear.h"
14#include "parseby.h"
15#include "abnorm.h"
16#include "macex.h"
17#include "syscmd.h"
18#include "stab.h"
19#include "symbol.h"
20#include "syme.h"
21#include "abpretty.h"
22#include "format.h"
23#include "comsg.h"
24#include "scobind.h"
25#include "abuse.h"
26#include "opsys.h"
27#include "ablogic.h"
28#include "sexpr.h"
29#include "spesym.h"
30#include "debug.h"
31#include "optfoam.h"
32#include "tfsat.h"
33#include "formatters.h"
34
35localstatic AbSyn shexpParse(String);
36
37/*
38 * Usage: showexports libName type-expression
39 * Example: showexports libaldor.al 'List(Integer)'
40 */
41int
42main(int argc, char *argv[])
43{
44 AbSyn arAbSyn;
45 AbSyn boolean;
46 AbSyn ab;
47 Stab stab;
48 Syme syme;
49 TForm tf;
50
51 String archive;
52 String expression;
53
54 osInit();
55 sxiInit();
56 keyInit();
57 ssymInit();
58 dbInit();
59 stabInitGlobal();
60 tfInit();
61 fmttsInit();
62 foamInit();
63 optInit();
64 tinferInit();
65 pathInit();
66
67 sposInit();
68 ablogInit();
69 comsgInit();
70
71 macexInitFile();
72 comsgInit();
73 scobindInitFile();
74 stabInitFile();
75
76 fileAddLibraryDirectory(".");
77
78 archive = argv[1];
79 expression = argv[2];
80
81 scmdHandleLibrary("LIB", archive);
82
83 ab = shexpParse(expression);
84 stab = stabFile();
85 syme = stabGetArchive(symInternConst("LIB")symProbe("LIB", 1));
Value stored to 'syme' is never read
86 arAbSyn = abNewId(sposNone, symInternConst("LIB"))abNew(AB_Id, sposNone,1, symProbe("LIB", 1));
87 boolean = abNewId(sposNone, symInternConst("Boolean"))abNew(AB_Id, sposNone,1, symProbe("Boolean", 1));
88
89 stabImportTForm(stab, tiGetTForm(stab, arAbSyn));
90 stabImportTForm(stab, tiGetTForm(stab, boolean));
91 abPutUse(ab, AB_Use_Value);
92 scopeBind(stab, ab);
93 typeInfer(stab, ab);
94 tf = tiGetTForm(stab, ab);
95 aprintf("Type: %s Cat: %d\n", tfPretty(tf), tfSatCat(tf));
96 if (tfSatDom(tf)) {
97 SymeList list = tfGetCatExports(tf);
98 aprintf("Category\n");
99 for (; list != listNil(Syme)((SymeList) 0); list = cdr(list)((list)->rest)) {
100 Syme syme = car(list)((list)->first);
101 aprintf("%5s %3d %s %pAbSynList\n", symeString(syme)((((syme)->id))->str), symeHasDefault(syme)(((((syme)->kind == SYME_Trigger ? libGetAllSymes((syme)->
lib) : ((void*)0)), (syme))->bits) & (0x0080))
,
102 tfPretty(symeType(syme)), symeCondition(syme));
103 }
104 }
105 else {
106 TQualList tqList;
107 SymeList list = tfStabGetDomImports(stab, tf);
108 aprintf(">>> Exports\n");
109
110 for (; list != listNil(Syme)((SymeList) 0); list = cdr(list)((list)->rest)) {
111 Syme syme = car(list)((list)->first);
112 aprintf("%s %d %d %s\n", symeString(syme)((((syme)->id))->str),
113 symeDefnNum(syme)((int) (SYFI_DefnNum < (8 * sizeof(int)) && !(((((
syme)->kind == SYME_Trigger ? libGetAllSymes((syme)->lib
) : ((void*)0)), (syme))->hasmask) & (1 << (SYFI_DefnNum
))) ? (symeFieldInfo[SYFI_DefnNum].def) : (((((syme)->kind
== SYME_Trigger ? libGetAllSymes((syme)->lib) : ((void*)0
)), (syme))->locmask) & (1 << (SYFI_DefnNum))) ?
((((((syme)->kind == SYME_Trigger ? libGetAllSymes((syme)
->lib) : ((void*)0)), (syme))->locmask) & (1 <<
(SYFI_DefnNum))) ? ((syme)->fieldv)[symeIndex(syme,SYFI_DefnNum
)] : (symeFieldInfo[SYFI_DefnNum].def)) : symeGetFieldFn(syme
,SYFI_DefnNum)))
, symeConstNum(syme)(((AInt) (SYFI_ConstInfo < (8 * sizeof(int)) && !(
((((syme)->kind == SYME_Trigger ? libGetAllSymes((syme)->
lib) : ((void*)0)), (syme))->hasmask) & (1 << (SYFI_ConstInfo
))) ? (symeFieldInfo[SYFI_ConstInfo].def) : (((((syme)->kind
== SYME_Trigger ? libGetAllSymes((syme)->lib) : ((void*)0
)), (syme))->locmask) & (1 << (SYFI_ConstInfo)))
? ((((((syme)->kind == SYME_Trigger ? libGetAllSymes((syme
)->lib) : ((void*)0)), (syme))->locmask) & (1 <<
(SYFI_ConstInfo))) ? ((syme)->fieldv)[symeIndex(syme,SYFI_ConstInfo
)] : (symeFieldInfo[SYFI_ConstInfo].def)) : symeGetFieldFn(syme
,SYFI_ConstInfo))) & 0xFFFF)
, tfPretty(symeType(syme)));
114 }
115
116 aprintf(">>> Cascades\n");
117 tqList = tfGetDomCascades(tf);
118
119 for (; tqList != listNil(TQual)((TQualList) 0); tqList = cdr(tqList)((tqList)->rest)) {
120 TQual tq = car(tqList)((tqList)->first);
121 aprintf("--> %s\n", tfPretty(tqBase(tq)((tq)->base)));
122 }
123 }
124
125 scobindFiniFile();
126 stabFiniFile();
127 comsgFini();
128 macexFiniFile();
129 dbFini();
130
131 return 0;
132}
133
134localstatic AbSyn
135shexpParse(String txt)
136{
137 AbSyn ab;
138 TokenList tl;
139 SrcLineList sll;
140 SrcLine srcLine = slineNew(sposNone, 0, txt);
141
142 sll = listList(SrcLine)(SrcLine_listPointer->List)(1, srcLine);
143 tl = scan(sll);
144 tl = linearize(tl);
145 ab = parse(&tl);
146 ab = abNormal(ab, false((int) 0));
147 ab = macroExpand(ab);
148 ab = abNormal(ab, true1);
149
150 return ab;
151}