Skip to content

Commit

Permalink
Disable Clang C-style variadic warnings in autosprintf
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben RUBSON committed Nov 7, 2017
1 parent 00bd6d3 commit 9766a6c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions encfs/autosprintf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
namespace gnu {

/* Constructor: takes a format string and the printf arguments. */
autosprintf::autosprintf(const char *format, ...) {
autosprintf::autosprintf(const char *format, ...) { // NOLINT (cert-dcl50-cpp) as it's not critical
va_list args;
va_start(args, format);
if (vasprintf(&str, format, args) < 0) {
Expand All @@ -50,7 +50,9 @@ autosprintf::autosprintf(const autosprintf &src) {
}

/* Destructor: frees the temporarily allocated string. */
autosprintf::~autosprintf() { free(str); }
autosprintf::~autosprintf() {
free(str); // NOLINT (cppcoreguidelines-no-malloc) as it's a consequence of vasprintf / variadic function above
}

/* Conversion to string. */
autosprintf::operator char *() const {
Expand Down

0 comments on commit 9766a6c

Please sign in to comment.