| Summary: | KDevelop must create pragma once with include guards | ||
|---|---|---|---|
| Product: | [Applications] kdevelop | Reporter: | Denis Pesotsky <denis> |
| Component: | Language Support: CPP (old) | Assignee: | kdevelop-bugs-null |
| Status: | RESOLVED INTENTIONAL | ||
| Severity: | wishlist | CC: | maty78485 |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | 4.2.0 | ||
| Platform: | unspecified | ||
| OS: | Unspecified | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
Why? Apart from this being _very_ compiler-specific as opposed to the include-guards I don't see a reason for doing both. The compiler that does know pragma's can work just fine with include-guards as well - afaik. > The compiler that does know pragma's can work just fine with include-guards as well
Did not know that. You mean, that all popular compilers (including gcc, vcc etc) support include guards optimisation if they have pragma once support?
I would give the user a choice - whether to use `#pragma once` or `#ifndef / #define` include guards. |
Version: unspecified (using KDE 4.5.5) OS: unspecified When I create class for C/C++ with Project Manager's "Create Class", it creates header with include guards. But it will be nice, if it will also add pragma once there. Reproducible: Didn't try Steps to Reproduce: Create Class with project manager. Actual Results: Header will look like: #ifndef MAINWINDOW_H #define MAINWINDOW_H class MainWindow { }; #endif // MAINWINDOW_H Expected Results: Will be nice if header will look like: #pragma once #ifndef MAINWINDOW_H #define MAINWINDOW_H class MainWindow { }; #endif // MAINWINDOW_H