Skip to content

itt: emit = {0} instead of = {} for _retval - #524

Merged
TApplencourt merged 1 commit into
develfrom
itt-c23-empty-init
Aug 4, 2026
Merged

itt: emit = {0} instead of = {} for _retval#524
TApplencourt merged 1 commit into
develfrom
itt-c23-empty-init

Conversation

@TApplencourt

Copy link
Copy Markdown
Collaborator

Type _retval = {}; is an empty initializer, which is only valid for scalars from C23 on; older compilers reject it with "empty scalar initializer" (gcc 12 does, gcc 13 accepts it, which is why CI never caught this). = {0} zero-initializes both scalars and aggregates and is valid well before C23, so it keeps _retval initialized.

IF we move to c23 one-day, we can modernize the code.

`Type _retval = {};` is an empty initializer, which is only valid for
scalars from C23 on; older compilers reject it with "empty scalar
initializer" (gcc 12 does, gcc 13 accepts it, which is why CI never
caught this). `= {0}` zero-initializes both scalars and aggregates and
is valid well before C23, so it keeps _retval initialized -- it is read
by the tracepoint before being assigned -- without the dialect
requirement.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@TApplencourt
TApplencourt merged commit eca8140 into devel Aug 4, 2026
24 of 26 checks passed
@TApplencourt
TApplencourt deleted the itt-c23-empty-init branch August 4, 2026 20:44
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.

1 participant