If argv[1] is a list enif_is_list(env, argv[1]) will be true and !enif_is_list(env, argv[1]) will be false which reduces the expression effectively to:
if(false && !enif_get_list_cell(env, argv[1], &head, &tail))
2) There is a sequence point after evaluation of the first (left) operand and before evaluation of the second (right) operand of the following binary operators: && (logical AND), || (logical OR), and , (comma).
enif_get_list_cell(env, argv[1], &head, &tail) this is never evaluated hence head and tail were never assigned!
https://github.com/K2InformaticsGmbH/oranif/blob/8a555c02e94cd1fad1eeecf7e7f0e06bceea8c37/c_src/dpiConn_nif.c#L311-L313 https://github.com/K2InformaticsGmbH/oranif/blob/8a555c02e94cd1fad1eeecf7e7f0e06bceea8c37/c_src/dpiStmt_nif.c#L28-L30
If
argv[1]
is a listenif_is_list(env, argv[1])
will be true and!enif_is_list(env, argv[1])
will be false which reduces the expression effectively to:if(false && !enif_get_list_cell(env, argv[1], &head, &tail))
According to https://en.cppreference.com/w/c/language/eval_order
enif_get_list_cell(env, argv[1], &head, &tail)
this is never evaluated hencehead
andtail
were never assigned!