This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Add new line after assert message
ClosedPublic

Authored by vitalybuka on Jan 19 2023, 11:34 PM.

Details

Reviewers
ldionne
philnik
Mordante
Group Reviewers
Restricted Project
Commits
rGc4bd5977f429: [libcxx] Add new line after assert message
Summary

Abort signal handler may print aswell. Without new line it goes into the
same.

Diff Detail

Event Timeline

vitalybuka created this revision.Jan 19 2023, 11:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 19 2023, 11:34 PM
vitalybuka requested review of this revision.Jan 19 2023, 11:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 19 2023, 11:34 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Mordante added inline comments.
libcxx/src/verbose_abort.cpp
39 ↗(On Diff #490732)

would it be possible to add require the newline in the format of __libcpp_verbose_abort? If not I'm happy with this approach.

vitalybuka added inline comments.Jan 20 2023, 5:42 PM
libcxx/src/verbose_abort.cpp
39 ↗(On Diff #490732)

would it be possible to add require the newline in the format of __libcpp_verbose_abort? If not I'm happy with this approach.

Here? https://github.com/llvm/llvm-project/blob/de6b75c4ab130a3c798f691923b4b78b773e53cc/libcxx/include/__assert#L44

\n is reasonable for stderr, but I am not sure if \n is appropriate for Apple and Android stuff below

ldionne added inline comments.Jan 25 2023, 7:52 AM
libcxx/src/verbose_abort.cpp
39 ↗(On Diff #490732)

I think it would be reasonable. I think I'd be happier with that approach too:

::std::__libcpp_verbose_abort("%s:%d: assertion %s failed: %s\n", __FILE__, __LINE__, #expression, message))
vitalybuka updated this revision to Diff 503490.Mar 8 2023, 1:11 PM

remove assert

philnik accepted this revision.Jun 22 2023, 2:48 PM
philnik added a subscriber: philnik.

Let's wait a few days (maybe until Tuesday or Wednesday) and see if @Mordante or @ldionne have any more comments. If not, feel free to land this. This has been open way too long for the amount of change.

This revision is now accepted and ready to land.Jun 22 2023, 2:48 PM
Mordante accepted this revision.Jun 24 2023, 6:55 AM

ping

Sorry this slipped under the radar. LGTM!

This revision was automatically updated to reflect the committed changes.