[dpdk-dev] [RFC 10/35] eal: introduce RTE_DECONST macro

Olivier MATZ olivier.matz at 6wind.com
Thu Mar 10 09:11:52 CET 2016


> I would rather have the mempool_audit code take a non-const argument.
> The macro method sets a bad precedent and will encourage more bad code.
> Plus code checkers are likely to flag any such usage as suspect.

Doing that would imply dropping the const qualifier in several
functions:

- rte_mempool_dump()
- rte_mempool_audit()
- mempool_audit_cookies()
- mempool_audit_cache()

This is maybe acceptable, but I think it is more important to
keep a const in the API, explicitly saying to the API user that
this parameter is read only.


Olivier


More information about the dev mailing list