Skip to content

Conversation

@mikebeaton
Copy link
Contributor

Description

This PR fixes a relatively minor but genuine code bug identified by XCODE5 build.

  • Breaking change?
    • NO.
  • Impacts security?
    • NO.
  • Includes tests?
    • NO.

How This Was Tested

Confirm valid XCODE5 build after changes. Confirm no break in EDK 2 CI.

Integration Instructions

N/A

@leiflindholm
Copy link
Member

Presumably this bug was hidden from other toolchains by the otherwise pointless initialization to 0 on line 279.

However, BrotliUefiDecompress () is the only caller of the library-internal BrotliDecompress (), and neither of them make any use of the value stored.
Is this just some weird copy-paste error via BrotliUefiDecompressGetInfo ()?
It seems the variable, and the argument, could be dropped outright.

mikebeaton added a commit to mikebeaton/edk2 that referenced this pull request Nov 8, 2025
DestSize should have been received and passed as a pointer in order to
successfully pass the output value.

The existence of this error was spotted by XCODE5 toolchain, which gave:
BrotliDecompress.c:85:18: error: parameter 'DestSize' set but not used

As discussed in tianocore#11729, since the
method is in fact internal and only called in one place, and since the
DestSize return value is in fact unused, instead of fixing the parameter
and method call we instead remove the parameter and mark the method STATIC.

Signed-off-by: Mike Beaton <[email protected]>
mikebeaton added a commit to mikebeaton/edk2 that referenced this pull request Nov 8, 2025
DestSize should have been received and passed as a pointer in order to
successfully pass the output value.

The existence of this error was spotted by XCODE5 toolchain, which gave:
BrotliDecompress.c:85:18: error: parameter 'DestSize' set but not used

As discussed in tianocore#11729, since the
method is in fact internal and only called in one place, and since the
DestSize return value is in fact unused, instead of fixing the parameter
and method call we instead remove the parameter, also marking the method
STATIC and renaming it to ...Internal.

Signed-off-by: Mike Beaton <[email protected]>
@mikebeaton
Copy link
Contributor Author

@leiflindholm - Looking at the code, IMO the intention may have been to provide something which could be called elsewhere. However it is not declared in any header file and never is called elsewhere. So I've updated the PR to remove the broken parameter completely, and marked the method STATIC and renamed it as ...Internal.

DestSize should have been received and passed as a pointer in order to
successfully pass the output value.

The existence of this error was spotted by XCODE5 toolchain, which gave:
BrotliDecompress.c:85:18: error: parameter 'DestSize' set but not used

As discussed in tianocore#11729, since the
method is in fact internal and only called in one place, and since the
DestSize return value is in fact unused, instead of fixing the parameter
and method call we instead remove the parameter, also marking the method
STATIC and renaming it to ...Internal.

Signed-off-by: Mike Beaton <[email protected]>
mikebeaton added a commit to mikebeaton/edk2 that referenced this pull request Nov 8, 2025
DestSize should have been received and passed as a pointer in order to
successfully pass the output value.

The existence of this error was spotted by XCODE5 toolchain, which gave:
BrotliDecompress.c:85:18: error: parameter 'DestSize' set but not used

As discussed in tianocore#11729, since the
method is in fact internal and only called in one place, and since the
DestSize return value is in fact unused, instead of fixing the parameter
and method call we instead remove the parameter, also marking the method
STATIC and renaming it to ...Internal.

Signed-off-by: Mike Beaton <[email protected]>
mikebeaton added a commit to mikebeaton/edk2 that referenced this pull request Nov 9, 2025
DestSize should have been received and passed as a pointer in order to
successfully pass the output value.

The existence of this error was spotted by XCODE5 toolchain, which gave:
BrotliDecompress.c:85:18: error: parameter 'DestSize' set but not used

As discussed in tianocore#11729, since the
method is in fact internal and only called in one place, and since the
DestSize return value is in fact unused, instead of fixing the parameter
and method call we instead remove the parameter, also marking the method
STATIC and renaming it to ...Internal.

Signed-off-by: Mike Beaton <[email protected]>
mikebeaton added a commit to acidanthera/audk that referenced this pull request Nov 16, 2025
DestSize should have been received and passed as a pointer in order to
successfully pass the output value.

The existence of this error was spotted by XCODE5 toolchain, which gave:
BrotliDecompress.c:85:18: error: parameter 'DestSize' set but not used

As discussed in tianocore/edk2#11729, since the
method is in fact internal and only called in one place, and since the
DestSize return value is in fact unused, instead of fixing the parameter
and method call we instead remove the parameter, also marking the method
STATIC and renaming it to ...Internal.

Signed-off-by: Mike Beaton <[email protected]>
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