Skip to content

Commit 9225753

Browse files
committed
Silence a -Wsuggest-attribute lint under GCC
1 parent ea9aecc commit 9225753

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/CppSQLite3.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414

1515
#define CPPSQLITE_ERROR 1000
1616

17+
#if defined(__GNUC__) || defined(__clang__)
18+
#define CPPSQLITE_ATTR_CONST __attribute__((const))
19+
#else
20+
#define CPPSQLITE_ATTR_CONST
21+
#endif
22+
1723
namespace detail {
1824
/**
1925
* RAII class for managing memory allocated by sqlite
@@ -69,7 +75,7 @@ class CppSQLite3Exception : public std::exception {
6975

7076
const char *what() const noexcept override { return mpszErrMess; }
7177

72-
static const char *errorCodeAsString(int nErrCode);
78+
static const char *errorCodeAsString(int nErrCode) CPPSQLITE_ATTR_CONST;
7379

7480
private:
7581
char *mpszErrMess;
@@ -306,4 +312,5 @@ class CppSQLite3DB {
306312
int mnBusyTimeoutMs;
307313
};
308314

315+
#undef CPPSQLITE_ATTR_CONST
309316
#endif

0 commit comments

Comments
 (0)