Skip to content

Commit 3ac26e5

Browse files
authored
Merge pull request #64 from KxSystems/compiler_flags
stricter compiler flags
2 parents 0b02c03 + 85de8fc commit 3ac26e5

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CFLAGS=-ggdb3 -O2 -Wno-pointer-sign -Wno-parentheses
1+
CFLAGS=-ggdb3 -O2 -Wno-pointer-sign -Wno-parentheses -Wextra -Werror -Wsign-compare -Wwrite-strings
22
ifeq ($(shell uname),Linux)
33
LDFLAGS=-fPIC -shared
44
QLIBDIR=l64

py.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ZV*t1(){R PyEval_SaveThread();}ZV t0(V*t){PyEval_RestoreThread(t);}ZP M;ZV**N;ZP
66
ZP p1(P p){Py_IncRef(p);R p;}ZV p0(P p){Py_DecRef(p);}ZI pt(P p,P t){P u=PyObject_Type(p);I f;f=(u==t||PyType_IsSubtype(u,t));p0(u);R f;}
77
ZP pg(K x){R(P)(kK(x)[1]);}ZV pd(K x){I g=g1();p0(pg(x));g0(g);}ZK kfp(P p){K x=knk(2,pd,p);R xt=112,x;}ZI pq(K x){R xt==112&&xn==2&&*kK(x)==(K)pd;}
88
ZK kfg(P p){R PyCapsule_GetPointer(p,"k");}ZV kfd(P p){r0(kfg(p));}ZP pfk(K x){R PyCapsule_New(r1(x),"k",kfd);}
9-
ZK prr(S s){ZC __thread b[4096];J n=sizeof(b)-1;P t,v,d,a;*b=0;strncat(b,s,n);PyErr_Fetch(&t,&v,&d);if(t){PyErr_NormalizeException(&t,&v,&d);
9+
ZK prr(S s){Z __thread C b[4096];J n=sizeof(b)-1;P t,v,d,a;*b=0;strncat(b,s,n);PyErr_Fetch(&t,&v,&d);if(t){PyErr_NormalizeException(&t,&v,&d);
1010
strncat(strncat(b,": ",n),PyUnicode_AsUTF8AndSize(a=PyObject_Str(v),0),n);p0(a);p0(t);p0(v);p0(d);}R krr(b);}ZK prg(S s,I g){K r=prr(s);g0(g);R r;}
1111

1212
ZK ko(P);ZK cf;//k from python

py.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,9 @@ ZI pyn(V**v){
116116
#define X(r,n,a,i) U(n=(T##n(*)a)v[i])
117117
NF
118118
R 1;}
119+
#ifdef __clang__
120+
#pragma clang diagnostic ignored "-Wincompatible-pointer-types-discards-qualifiers"
121+
#pragma clang diagnostic ignored "-Wunused-parameter"
122+
#elif __GNUC__
123+
#pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
124+
#endif

0 commit comments

Comments
 (0)