Skip to content

Conversation

@chqrlie
Copy link
Contributor

@chqrlie chqrlie commented Dec 30, 2025

  • add @(deprecated="msg") attribute for functions that should not be used
  • mark library functions gets(), strncpy() and strncat() as deprecated
  • replace bogus call to strncpy() with pstrcpy()

@bvdberg
Copy link
Member

bvdberg commented Dec 31, 2025

this will be handy to have. Could you also change the FunctionDecl.print() to show the attribute if printed?

Also I think we need a new warning category for this, that you can disable (enabled by default). So change from error to warning?

* add `@(deprecated="msg")` attribute for functions that should not be used
* mark library functions `gets()`, `strncpy()` and `strncat()` as deprecated
* make `tmpnam()` and `tempnam()` as deprecated
* add `mktemp()`, `mkstemp()` and `mkdtemp()` in unistd.c2i
* replace bogus call to `strncpy()` with `pstrcpy()`
* emit warning on calls to deprecated functions
* suppress warning with -Wno-deprecated
@chqrlie
Copy link
Contributor Author

chqrlie commented Dec 31, 2025

this will be handy to have. Could you also change the FunctionDecl.print() to show the attribute if printed?

Done

Also I think we need a new warning category for this, that you can disable (enabled by default). So change from error to warning?

I added a new deprecated warning category, disabled with-Wno-deprecated, and added more tests for this.

@bvdberg
Copy link
Member

bvdberg commented Jan 2, 2026

merged

@bvdberg bvdberg closed this Jan 2, 2026
@chqrlie chqrlie deleted the deprecated branch January 2, 2026 15:31
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