Skip to content

Commit

Permalink
[CLIENT-2527] CI/CD: compile Python client with -Werror (#496)
Browse files Browse the repository at this point in the history
* Fix all warning errors
  • Loading branch information
juliannguyen4 authored Aug 24, 2023
1 parent 4d9d413 commit 961119b
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ jobs:

- name: Build client
run: python3 -m build
env:
CFLAGS: '-Werror'

- name: Send wheel to test jobs
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.0.0-rc.2
14.0.0-rc.4
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@
'z'
]

##########################
# GITHUB ACTIONS SETTINGS
##########################

if COVERAGE:
extra_compile_args.append('-fprofile-arcs')
extra_compile_args.append('-ftest-coverage')
Expand Down
4 changes: 2 additions & 2 deletions src/main/aerospike.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static int Aerospike_Clear(PyObject *aerospike)
PyMODINIT_FUNC PyInit_aerospike(void)
{

const char version[] = "14.0.0-rc.2";
const char version[] = "14.0.0-rc.4";
// Makes things "thread-safe"
Py_Initialize();
int i = 0;
Expand All @@ -155,7 +155,7 @@ PyMODINIT_FUNC PyInit_aerospike(void)
PyObject *aerospike = PyModule_Create(&moduledef);

// In case adding objects to module fails, we can properly deallocate the module state later
memset(Aerospike_State(aerospike), NULL, sizeof(struct Aerospike_State));
memset(Aerospike_State(aerospike), 0, sizeof(struct Aerospike_State));

Aerospike_Enable_Default_Logging();

Expand Down
4 changes: 2 additions & 2 deletions src/main/client/bit_operate.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ static as_status add_op_bit_add(AerospikeClient *self, as_error *err, char *bin,
return err->code;
}

uint64_t action_int64;
int64_t action_int64;
if (get_int64_t(err, ACTION_KEY, op_dict, &action_int64) != AEROSPIKE_OK) {
return err->code;
}
Expand Down Expand Up @@ -808,7 +808,7 @@ static as_status add_op_bit_subtract(AerospikeClient *self, as_error *err,
return err->code;
}

uint64_t action_int64;
int64_t action_int64;
if (get_int64_t(err, ACTION_KEY, op_dict, &action_int64) != AEROSPIKE_OK) {
return err->code;
}
Expand Down
5 changes: 2 additions & 3 deletions src/main/conversions.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,6 @@ as_status pyobject_to_strArray(as_error *err, PyObject *py_list, char **arr,
{

as_error_reset(err);
PyObject *py_u_str = NULL;

if (!PyList_Check(py_list)) {
return as_error_update(err, AEROSPIKE_ERR_CLIENT, "not a list");
Expand Down Expand Up @@ -834,7 +833,7 @@ as_status pyobject_to_val(AerospikeClient *self, as_error *err,
Py_DECREF(py_parameter);

PyObject *geospatial_dump = AerospikeGeospatial_DoDumps(py_data, err);
char *geo_value = PyUnicode_AsUTF8(geospatial_dump);
const char *geo_value = PyUnicode_AsUTF8(geospatial_dump);
char *geo_value_cpy = strdup(geo_value);

Py_DECREF(py_data);
Expand Down Expand Up @@ -919,7 +918,7 @@ as_status pyobject_to_record(AerospikeClient *self, as_error *err,
PyObject *key = NULL, *value = NULL;
Py_ssize_t pos = 0;
Py_ssize_t size = PyDict_Size(py_rec);
char *name = NULL;
const char *name;
long ret_val = 0;

as_record_init(rec, size);
Expand Down
1 change: 0 additions & 1 deletion src/main/query/where.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ AerospikeQuery *AerospikeQuery_Where_Invoke(AerospikeQuery *self,
AerospikeQuery *AerospikeQuery_Where(AerospikeQuery *self, PyObject *args)
{
as_error err;
PyObject *py_err = NULL;

PyObject *py_pred = NULL;
PyObject *py_cdt_ctx = NULL;
Expand Down

0 comments on commit 961119b

Please sign in to comment.