Skip to content

Remove NDEBUG constant #5529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented May 5, 2020

It was only used in our patched libmagic in a very convoluted way.

The PHP_DEBUG and ZEND_DEBUG constants are always defined and should be used instead.

I came across this while working on #5526

@nikic
Copy link
Member

nikic commented May 5, 2020

NDEBUG is a standard C constant, I don't think we should drop it. This will break code using assert() rather than ZEND_ASSERT for example.

@Girgias
Copy link
Member Author

Girgias commented May 5, 2020

NDEBUG is a standard C constant, I don't think we should drop it. This will break code using assert() rather than ZEND_ASSERT for example.

TIL, should I keep the libmagic change and drop the rest?

@Girgias Girgias force-pushed the ndebug-remove-constant branch from 8f35a3f to f8be942 Compare May 5, 2020 17:34
@nikic
Copy link
Member

nikic commented May 6, 2020

I'd prefer leaving libmagic alone as well, because #ifndef NDEBUG around variables used only in assert() is also a standard pattern.

@Girgias
Copy link
Member Author

Girgias commented May 6, 2020

I'd prefer leaving libmagic alone as well, because #ifndef NDEBUG around variables used only in assert() is also a standard pattern.

ACK

@Girgias Girgias closed this May 6, 2020
@Girgias Girgias deleted the ndebug-remove-constant branch May 6, 2020 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants