Skip to content

Restrict use of functions in a kata #2703

Answered by interrupt-routine
bitcanon asked this question in Q&A
Discussion options

You must be logged in to vote

You can disable a C function by writing a dummy function with the same name in setup.c (preloaded) or fixture.c (tests)
Be careful since most math.h functions exist in 3 flavors for float ('f' suffix), double (no suffix) and long double ('l' suffix) e.g. powf(), pow(), powl()
Disabling a header is not very useful, since undeclared functions just emit a warning, and user can just copy-paste the declarations they need anyway.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@bitcanon
Comment options

Answer selected by bitcanon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants