clang -cc1 -cc1 -triple x86_64-unknown-linux-gnu -O3 -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name dump_header.cc -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -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=none -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=/data/b2soft/buildbot/development/build -fcoverage-compilation-dir=/data/b2soft/buildbot/development/build -resource-dir /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/lib/clang/21 -isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/include/c++ -isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/include/c++/x86_64-redhat-linux -isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/include/c++/backward -isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/include -isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/include/python3.12 -isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/include/CLHEP -isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/include/Geant4 -isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/include -isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/include/root -isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/include/belle_legacy -I include/ -D _PACKAGE_="daq" -D G4UI_USE_TCSH -D RaveDllExport= -D HAS_SQLITE -D HAS_CALLGRIND -I include -I /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/include/libxml2 -internal-isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/bin/../lib64/gcc/x86_64-redhat-linux/15.2.0/../../../../include/c++ -internal-isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/bin/../lib64/gcc/x86_64-redhat-linux/15.2.0/../../../../include/c++/x86_64-redhat-linux -internal-isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/bin/../lib64/gcc/x86_64-redhat-linux/15.2.0/../../../../include/c++/backward -internal-isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/lib/clang/21/include -internal-isystem /usr/local/include -internal-isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/bin/../lib64/gcc/x86_64-redhat-linux/15.2.0/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-missing-braces -Wno-unused-command-line-argument -std=c++20 -fdeprecated-macro -ferror-limit 19 -fgnuc-version=4.2.1 -fno-implicit-modules -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -vectorize-loops -vectorize-slp -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /scan_build/2026-05-31-004316-385593-1 -x c++ daq/rawdata/tools/dump_header.cc
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | #include <stdio.h> |
| 10 | #include <unistd.h> |
| 11 | #include <vector> |
| 12 | |
| 13 | using namespace std; |
| 14 | |
| 15 | enum { |
| 16 | POS_NWORDS = 0, |
| 17 | POS_HDR_NWORDS = 1, |
| 18 | POS_NUM_EVE_NUM_NODES = 2, |
| 19 | POS_EXP_RUN_NUM = 3, |
| 20 | POS_EVE_NUM = 4, |
| 21 | POS_NODE_ID = 5 |
| 22 | }; |
| 23 | |
| 24 | enum { |
| 25 | EXP_MASK = 0xFFC00000, |
| 26 | EXP_SHIFT = 22, |
| 27 | RUNNO_MASK = 0x003FFF00, |
| 28 | RUNNO_SHIFT = 8, |
| 29 | SUBRUNNO_MASK = 0x000000FF |
| 30 | }; |
| 31 | |
| 32 | |
| 33 | |
| 34 | int main() |
| 35 | { |
| 36 | vector<unsigned int> buf(400000); |
| 37 | int infn = fileno(stdin); |
| 38 | printf("infn = %d\n", infn); |
| 39 | |
| 40 | int nrec = 0; |
| 41 | for (;;) { |
| 42 | int is = read(infn, &buf[0], 4); |
| 43 | |
| 44 | if (is <= 0) break; |
| 45 | is = read(infn, &buf[1], (buf[0] - 1) * 4); |
| Value stored to 'is' is never read |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | int exp = (buf[ POS_EXP_RUN_NUM ] & EXP_MASK) >> EXP_SHIFT; |
| 51 | int run = (buf[ POS_EXP_RUN_NUM ] & RUNNO_MASK) >> RUNNO_SHIFT; |
| 52 | int evt = buf[ POS_EVE_NUM ]; |
| 53 | |
| 54 | printf("Nrec:%d ; Nw:%u ; Exp:%d, Run:%d, Evt:%d\n", |
| 55 | nrec, buf[0], exp, run, evt); |
| 56 | nrec++; |
| 57 | } |
| 58 | |
| 59 | } |