You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for which the GitHub syntax highlighter does a good job of highlighting (hah!) the problem.
It would be convenient if cbindgen 'defused' those somehow. A candidate is changing every /* to ⁄* which is a different but similar Unicode symbol, and which is not a pretty but a practical solution; another is changing the whole comment to C++ style comments (/// in this case to trigger doxygen). A very fancy fix would be to extract all inline comments and put them at the end of the line (there's probably a reason they're inline, but then again, what do without C nested comments). A minimal fix to the "it produces unexpected and broken code" would also be to err out from the translation step (not a full fix, but still an improvement).
I have no clear preference how to fix this – I'll work around this by moving the comments to end-of-line C++ style comments, but given this whole issue might confuse users or even be used in an underhand code project, I hope cbindgen could fix it.
The text was updated successfully, but these errors were encountered:
If there is a C style comment inside a Rust comment, that's fine for Rust but produces broken C:
becomes
for which the GitHub syntax highlighter does a good job of highlighting (hah!) the problem.
It would be convenient if cbindgen 'defused' those somehow. A candidate is changing every
/*
to⁄*
which is a different but similar Unicode symbol, and which is not a pretty but a practical solution; another is changing the whole comment to C++ style comments (///
in this case to trigger doxygen). A very fancy fix would be to extract all inline comments and put them at the end of the line (there's probably a reason they're inline, but then again, what do without C nested comments). A minimal fix to the "it produces unexpected and broken code" would also be to err out from the translation step (not a full fix, but still an improvement).I have no clear preference how to fix this – I'll work around this by moving the comments to end-of-line C++ style comments, but given this whole issue might confuse users or even be used in an underhand code project, I hope cbindgen could fix it.
The text was updated successfully, but these errors were encountered: