Skip to content

Instantly share code, notes, and snippets.

View daparic's full-sized avatar

daparic

  • 14:53 (UTC +08:00)
View GitHub Profile
https://asciinema.org/a/q4opufgOywGvUf5V7DX9ZFUug
openjdk version "11.0.18" 2023-01-17 LTS
OpenJDK Runtime Environment Zulu11.62+17-CA (build 11.0.18+10-LTS)
OpenJDK 64-Bit Server VM Zulu11.62+17-CA (build 11.0.18+10-LTS, mixed mode)
#include <jni.h>
#include <stdlib.h>
#include <string.h>
static int zeroMethod() { return 0; }
static void assignmentRemainderOfMethodResult() {
int a = 5;
a %= zeroMethod(); // VIOLATION
}
export PS1="\n\e[44;1;37m\w \e[0m\n$ "
add_configs ()
{
if [ ! -d $1 ]; then
echo "*** cannot find ***";
return;
fi;
local x=$(find $1 -type d -name configs);
tar xf ~/configs.tar -C $x/c++test --strip-components=1
}
@daparic
daparic / tiny.c
Created September 30, 2023 09:41
tiny.c
int main(int argc, char *argv[])
{
int count = 0;
if (argc > 1) {
char *ch = argv[1];
while (*ch != '\0') {
if (*ch >= 'A' && *ch <= 'Z') {
count++;
}
ch++;
@daparic
daparic / ndk-build.md
Created September 28, 2023 02:18
Android / Parasoft ndk-build static analysis
@daparic
daparic / parasoft-sa.yml
Last active September 25, 2023 12:27
Parasoft Github CI/CD Yaml For Static Analysis
name: demo
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
workflow_dispatch:
jobs:
italian:
name: Run Parasoft Static Analysis
@daparic
daparic / dtp-machineid.sh
Last active September 18, 2023 14:46
DTP machineid
#!/bin/sh
/opt/parasoft/dtp/jre/bin/java \
-cp /opt/parasoft/dtp/tomcat/lib/*:/opt/parasoft/dtp/tomcat/webapps/pst/WEB-INF/lib/* \
-Djava.library.path="/opt/parasoft/dtp/lib/native" \
-DuseExternalLock=false \
toolkit.modules.main.pcc.MachineIdWrapper
@daparic
daparic / builtins-sa.sh
Created September 15, 2023 17:10
Run SA of builtins
#!/bin/sh
#
# C/C++ Standard
cpptestcli -list-configs | grep 'builtin://' | while read c;do
echo "*** $c ***"
r=`echo "$c"|tr -d '()/'|tr ': ' '-_'`
cpptestcli -config "$c" -bdf cpptestscan.bdf -report $r | tee /tmp/scan.log
cp /tmp/scan.log $r
done