Commit Graph

15 Commits (master)

Author SHA1 Message Date
Shivani Bhardwaj db75675f45 qa: add atoi to list of banned functions 5 years ago
Philippe Antoine f5190da67e util: UTHmemsearch to use memmem if defined 5 years ago
Victor Julien 2b581fa836 qa/banned-functions: remove strndup now we have a fall back 5 years ago
Victor Julien 5bfedf78fc posix: replace bzero with memset
bzero(3): The bzero() function is deprecated (marked as LEGACY in
POSIX.1-2001); use memset(3) in new programs.  POSIX.1-2008 removes
the specification of bzero().

Use memset instead.
6 years ago
Victor Julien 2da90a1cd8 posix: remove deprecated index/rindex calls
Replace index by strchr and rindex by strrchr.

index(3) states "POSIX.1-2008 removes the specifications of index() and
rindex(), recommending strchr(3) and strrchr(3) instead."

Add index/rindex to banned function check so they don't get reintroduced.

Bug #1443.
6 years ago
Victor Julien 90e612d3e4 cocci: ban memmem 8 years ago
Victor Julien ba61265403 qa: add rand/rand_r to banned functions 8 years ago
Andreas Herz b6de1b6567 coccinelle: fix typo for strchrnul 9 years ago
Victor Julien bc2b53f10b parsing: s/strtok/strtok_r/g
Remove all strtok uses and replace them by strtok_r.

Do the same for Windows builds. Cygwin builds fine with strtok_r.

Add strtok to banned function list.
10 years ago
Eric Leblond d7982fae8c coccinelle: fix problem with coccinelle 1.0rc21
coccinelle 1.0rc21 has a problem with regular expression handling.
This result in a Fatal Error when test system detects an coding
error.

This patch fixes the problem by using a simple blob inside
semantic patch instead of using a regular expression to define
the function.

It also fixes add an optimization on matching suppressing a
useless <.. ..> construction.

Fixes have been suggested by Julia Lawall.
11 years ago
Victor Julien 385c04164b Updated banned function cocci check
Added: strndup and strchrnul

Both are not supported on OS X 10.6. It's rather old, but it's the
only Mac QA box I have, so for now it'll have to do.
11 years ago
Eric Leblond 7cc87bc02a coccinelle: protecting regexp operator is not needed
It seems there was an evolution of coccinelle and the protection
of regexp is not necessary anymore. And doing it causing the
expression not to match.
11 years ago
Eric Leblond c36aa041f3 Update coccinelle script to match syntax evolution. 13 years ago
Victor Julien 076d77cd80 Add strncpy and strncat to banned function list as we have better replacements: strlcpy and strlcat. 14 years ago
Eric Leblond 7f1a0d1ed1 coccinelle: add test for banned function
The added semantic patch will trigger an error if banned functions
are used.
14 years ago