Skip to content

The first parameter of spall_buffer_init is not used by the function #42

@wind0204

Description

@wind0204

It's not a big issue but here I go.
spall_buffer_init does not use the first parameter it receives.

Here's the workaround for warning suppression:

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
SPALL_FN bool spall_buffer_init(SpallProfile *ctx, SpallBuffer *wb) {
#pragma GCC diagnostic pop
	// Fails if buffer is not big enough to contain at least one event!
	if (wb->length < sizeof(SpallBufferHeader) + sizeof(SpallBeginEventMax)) {
		return false;
	}

	wb->head = sizeof(SpallBufferHeader);
	return true;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions