TeamWin/Team-Win-Recovery-Project

Wrong string formatting used for size ("%zu")

Magendanz opened this issue · 5 comments

Device codename: All 32-bit
TWRP version: 3.6.0_11

WHAT STEPS WILL REPRODUCE THE PROBLEM?

Try to build TWRP on AOSP 11 for any 32-bit (ARM) device. I used platform_manifest_twrp_aosp.

WHAT IS THE EXPECTED RESULT?

Should be able to "mka recoveryimage" with no errors.

WHAT HAPPENS INSTEAD?

Compile fails, reporting type mismatch on line 94 of kernel_module_loader.cpp:

LOGINFO("number of modules loaded by init: %lu\n", loaded_modules.size());

ADDITIONAL INFORMATION

The problem is that the format string used ("%lu") isn't appropriate for a 32-bit size. This line should use "%zu" instead.

Changing this one character fixes the problem.

Submit a patch to Gerrit

I tried, but I don't have 'Push' rights. Do I have to fork and submit a pull request? (For a 1-character change?)

> git push origin android-11:android-11
remote: error: branch refs/heads/android-11:        
remote: To push into this reference you need 'Push' rights.        
remote: User: Magendanz        
remote: Contact an administrator to fix the permissions        
remote: 
remote: Processing changes: refs: 1
remote: Processing changes: refs: 1, done            
To https://gerrit.twrp.me/android_bootable_recovery
 ! [remote rejected]   android-11 -> android-11 (prohibited by Gerrit: not permitted: update)
error: failed to push some refs to 'https://gerrit.twrp.me/android_bootable_recovery'

Are you sure you're using Gerrit correctly? The URL is gerrit.twrp.me. It sounds like you're not using refs/for/ when pushing and instead you're trying to push directly. Can you confirm your process?

EDIT: Just saw the output, and I'm right; you have to push to refs/for/android-11, not directly to it.

...and you need to install the script that adds a Change-Id to the message footer. However, I seem to have figured it out and successfully made my first Gerrit push.

https://gerrit.twrp.me/c/android_bootable_recovery/+/4933

Merged, thanks for the submission.