cgmb / guardonce

Utilities for converting from C/C++ include guards to #pragma once and back again.
MIT License
142 stars 3 forks source link

Understand C++: Ignore strings #8

Closed cgmb closed 7 years ago

cgmb commented 11 years ago

When searching through files, anything within strings should be ignored as irrelevant.

cgmb commented 7 years ago

Finding a string (or anything but comments and other preprocessor directives) before the include guard should be an error.

cgmb commented 7 years ago

The benefits of this seem rather meager. Anything besides a comment or a preprocessor directive that is found before the include guard is an error. Only C++ raw strings could be mistaken for a preprocessor directive, and frankly supporting that is a long way off, if ever.

Issue #7 (ignore comments) is a far more useful first step towards a smarter guardonce, and I'm not even sure if that one really is useful. At least for now, this issue is just clutter.