[
https://issues.apache.org/jira/browse/TS-3347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15433314#comment-15433314
]
Alan M. Carroll commented on TS-3347:
-------------------------------------
Looking at this it's not as simple as it would seem ("Forget it Jake, it's
Traffic Server").
{code}
ink_assert(fwrite(message, strlen(message), 1, log) == 1);
{code}
You say, isn't this the obvious fix?
{code}
auto count = fwrite(message, strlen(message), 1, log);
int_assert(1 == count);
{code}
Why, no it is not. Because this will generate "unused variable" in release
mode, because in that mode {{count}} is not used. This is a generic problem
where there is a value returned that is checked only by {{ink_assert}}. I need
to ponder that a bit.
> Make ink_assert a no-op in release builds
> -----------------------------------------
>
> Key: TS-3347
> URL: https://issues.apache.org/jira/browse/TS-3347
> Project: Traffic Server
> Issue Type: Improvement
> Components: Core
> Reporter: Sudheer Vinukonda
> Assignee: Alan M. Carroll
> Fix For: 7.0.0
>
>
> ink_assert() is expected to be enabled only in DEBUG builds. However, the
> current definition of ink_assert() for non-DEBUG (release) builds, still
> evaluates the expression passed to it, which seems totally unnecessary.
> Opening this jira to make ink_assert() a complete no-op for non-DEBUG release
> builds. Along with the change of definition, need to scan the entire TS code
> to fix the code that relies on the expression evaluated in the ink_assert()
> accordingly.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)