askhad-apishev / corewar

0 stars 0 forks source link

Using <assert.h> in production code #1

Open askhad-apishev opened 5 years ago

askhad-apishev commented 5 years ago
header is forbidden in to use, but function assert() is very helpful for code understanding and for error prevention. for example ``` int ft_strlen(char *str) { assert(str != NULL); ... } ``` this instruction tells us that this function not work with NULL, that this function is not NULL safety. and when NULL will passed as value - we well see an assertion error, not a segmentation fault. so, we will know actual place of error. so, we can use it while coding, but this instruction will interfere for norminette checking, and we should remove all assert instructions from sources before closing project (for this we can write a parsing script)
srgbl commented 4 years ago

Could you please check is it really forbidden to use assert.h?

askhad-apishev commented 4 years ago

No, it's not forbidden.

Norme: src_vm/list_utils.c Norme: src_vm/parse_args.c

srgbl commented 4 years ago

It is forbidden eventually. Because we have a list of allowed functions in subject. So we have to sanitize project before submission.