KalleOlaviNiemitalo commented on PR #3128:
URL: https://github.com/apache/avro/pull/3128#issuecomment-2322199098
A trailing backslash might cause trouble. If the schema has `"doc": "Do not
use the backslash character \\"`, and you generate C++
```cpp
// Do not use the backslash character \
struct RootRecord {
...
```
then the preprocessor will treat the `struct RootRecord {` line as part of
the comment. This cannot be fixed by doubling the backslash; and with GCC,
this cannot be fixed by appending space characters either ([Escaped Newlines
(Using the GNU Compiler Collection
(GCC))](https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/Escaped-Newlines.html)).
I guess the code generator could detect that the last line of the comment ends
with a backslash (optionally followed by whitespace), and inject another
comment line;
```cpp
// Do not use the backslash character \
//
struct RootRecord {
...
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]