Debian Codegraph @

src/checks/level2/global-const-char-pointer.h

raw
1 /*
2 SPDX-FileCopyrightText: 2015 Klarälvdalens Datakonsult AB a KDAB Group company [email protected]
3 SPDX-FileContributor: Sérgio Martins <[email protected]>
4
5 SPDX-FileCopyrightText: 2015 Sergio Martins <[email protected]>
6
7 SPDX-License-Identifier: LGPL-2.0-or-later
8 */
9
10 #ifndef GLOBAL_CONST_CHAR_POINTER_H
11 #define GLOBAL_CONST_CHAR_POINTER_H
12
13 #include "checkbase.h"
14
15 #include <string>
16
17 /**
18 * Finds where you're using const char *foo; instead of const char *const foo; or const char []foo;
19 * The first case adds a pointer in .data, pointing to .rodata, the other cases only use .rodata
20 */
21 class GlobalConstCharPointer : public CheckBase
22 {
23 public:
24 GlobalConstCharPointer(const std::string &name, Options options);
25 void VisitDecl(clang::Decl *decl) override;
26 };
27
28 #endif