Skip to content

Conversation

@chqrlie
Copy link
Contributor

@chqrlie chqrlie commented Jun 27, 2025

  • compute the assert string and function call at parse time
  • add libc2 module in libs/libc/c2internals.c2i
  • add auto_func function parameter attribute
  • reject invalid combinations of auto_xxx attributes

@chqrlie chqrlie force-pushed the assert branch 2 times, most recently from ac7bab2 to f6f55a9 Compare June 27, 2025 20:11
@bvdberg
Copy link
Member

bvdberg commented Jun 28, 2025

It also has auto-arg changes.. please keep commits small so it's easier for me to review..

@chqrlie
Copy link
Contributor Author

chqrlie commented Jun 29, 2025

I just split this PR into 2 separate commits:

  • one for the new auto_func attribute and other attribute fixes
  • one for the c2_assert function migration to the library.


if (a.getCall()) {
qt = ma.analyseExpr(a.getCall2(), true, RHS);
if (qt.isInvalid()) return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which case will a.getCall() be nil?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the call expression is only constructed by the parser if asserts are enabled. The expression is always parsed and stored for the analyser.

@chqrlie chqrlie force-pushed the assert branch 6 times, most recently from e15d382 to 32c8780 Compare July 6, 2025 10:14
@chqrlie chqrlie force-pushed the assert branch 5 times, most recently from a483970 to 1fea052 Compare July 15, 2025 06:41
@chqrlie chqrlie force-pushed the assert branch 12 times, most recently from d7be4b3 to f5c7b25 Compare July 29, 2025 06:49
@chqrlie chqrlie force-pushed the assert branch 7 times, most recently from 66d79db to 279d496 Compare November 9, 2025 08:50
@chqrlie chqrlie force-pushed the assert branch 2 times, most recently from eff433d to e39ef71 Compare November 16, 2025 22:53
@chqrlie chqrlie force-pushed the assert branch 6 times, most recently from 9cc715d to 4dea1e6 Compare November 23, 2025 21:47
@chqrlie chqrlie force-pushed the assert branch 3 times, most recently from 26c83db to 490a7db Compare December 8, 2025 14:21
@chqrlie chqrlie force-pushed the assert branch 3 times, most recently from 9112eff to cd3548a Compare December 16, 2025 23:47
@chqrlie chqrlie force-pushed the assert branch 2 times, most recently from 89b3d15 to f045f27 Compare December 22, 2025 10:21
@chqrlie chqrlie force-pushed the assert branch 4 times, most recently from 605c52f to 1f65393 Compare December 31, 2025 10:40
* compute the assert string and function call at parse time
* add c2_assert module in C library interface libs/libc/c2_assert.c2i
* update tests
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