gcc-poison alternatives and similar libraries
Based on the "Miscellaneous" category.
Alternatively, view gcc-poison alternatives based on common mentions on social networks and blogs.
-
ZXing
ZXing ("Zebra Crossing") barcode scanning library for Java, Android -
RE2
RE2 is a fast, safe, thread-friendly alternative to backtracking regular expression engines like those used in PCRE, Perl, and Python. It is a C++ library. -
ZBar
Clone of the mercurial repository http://zbar.hg.sourceforge.net:8000/hgroot/zbar/zbar -
American fuzzy lop
american fuzzy lop - a security-oriented fuzzer -
Serial Communication Library
Cross-platform, Serial Port library written in C++ -
Better Enums
C++ compile-time enum to string, iteration, in a single header file -
c-smart-pointers
Smart pointers for the (GNU) C programming language -
Experimental Boost.DI
DI: C++14 Dependency Injection Library -
UNITS
a compile-time, header-only, dimensional analysis and unit conversion library built on c++14 with no dependencies. -
constexpr-8cc
Compile-time C Compiler implemented as C++14 constant expressions -
outcome
Provides very lightweight outcome<T> and result<T> (non-Boost edition) -
cxx-prettyprint
A header-only library for C++(0x) that allows automagic pretty-printing of any container. -
libcpuid
a small C library for x86 CPU detection and feature extraction -
CppVerbalExpressions
C++ regular expressions made easy -
kangaru
🦘 A dependency injection container for C++11, C++14 and later -
value-category-cheatsheet
A C++14 cheat-sheet on lvalues, rvalues, xvalues, and more -
casacore
Suite of C++ libraries for radio astronomy data processing -
StrTk
C++ String Toolkit Library https://www.partow.net/programming/strtk/index.html -
ub-canaries
collection of C/C++ programs that try to get compilers to exploit undefined behavior -
QtVerbalExpressions
This Qt lib is based off of the C++ VerbalExpressions library. [MIT] -
access_profiler
a tool to count accesses to member variables in c++ programs -
CommonPP
Small library helping you with basic stuff like getting metrics out of your code, thread naming, etc.
Write Clean C++ Code. Always.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of gcc-poison or a related project?
README
gcc-poison
gcc-poison is a simple header file for developers to ban unsafe C/C++ functions from applications. It uses the #pragma GCC poison directive to define a number of identifiers (function names) as unsafe. Compilation will fail if these are present in your code.
Please see http://blog.leafsr.com/2013/12/gcc-poison.html for more information
Example usage
#include <stdio.h>
#include <string.h>
#include "gcc-poison.h"
int main(int argc, char *argv[]) {
char buf[10];
strcpy(buf, argv[1]);
return 0;
}
$ gcc -o 2 2.c
1.c: In function ‘main’:
1.c:8:2: error: attempt to use poisoned "strcpy"
Excluding specific functions from poisoning
As pointed out in the GCC documentation (http://gcc.gnu.org/onlinedocs/cpp/Pragmas.html), "If a poisoned identifier appears as part of the expansion of a macro which was defined before the identifier was poisoned, it will not cause an error. This lets you poison an identifier without worrying about system headers defining macros that use it."
Here is an example of how to use gcc-poison.h but continue to allow the usage of the 'strcat' function, via a macro:
#define _unsafe_strcat strcat
#include "gcc-poison.h"
int main(void)
{
char x[512];
/* this will raise an error */
strcat((char *)&x, "lol");
/* ... while this will NOT raise an error */
_unsafe_strcat((char *)&x, "lol");
}
Note that you must define any such macros BEFORE you include gcc-poison.h. This can be a handy way to allow developers to continue to use certain functions for which libc has no safe alternative, while forcing them to acknowledge that they are doing so unsafely.