Opened 3 years ago

Closed 2 years ago

#12657 closed bug (fixed)

(easy) 64-bit type printf misalignment

Reported by: kallisti5 Owned by: nobody
Priority: low Milestone: Unscheduled
Component: File Systems/BFS Version: R1/Development
Keywords: easy Cc:
Blocked By: Blocking:
Has a Patch: yes Platform: x86-64

Description

C++ /home/kallisti5/Code/haiku-self/generated.x86_64/objects/linux/x86_64/release/tools/bfs_shell/command_checkfs.o 
/home/kallisti5/Code/haiku-self/src/tools/bfs_shell/command_checkfs.cpp: In function ‘fssh_status_t FSShell::command_checkfs(int, const char* const*)’:
/home/kallisti5/Code/haiku-self/src/tools/bfs_shell/command_checkfs.cpp:58:57: warning: format ‘%Ld’ expects argument of type ‘long long int’, but argument 2 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
    fssh_dprintf("%9Ld nodes processed\x1b[1A\n", counter);
                                                         ^
/home/kallisti5/Code/haiku-self/src/tools/bfs_shell/command_checkfs.cpp:62:64: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘fssh_ino_t {aka long int}’ [-Wformat=]
     fssh_dprintf("%s (inode = %lld)", result.name, result.inode);
                                                                ^
/home/kallisti5/Code/haiku-self/src/tools/bfs_shell/command_checkfs.cpp:119:58: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
   result.stats.blocks_in_direct * result.stats.block_size);
                                                          ^
/home/kallisti5/Code/haiku-self/src/tools/bfs_shell/command_checkfs.cpp:123:60: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
   result.stats.blocks_in_indirect * result.stats.block_size);
                                                            ^
/home/kallisti5/Code/haiku-self/src/tools/bfs_shell/command_checkfs.cpp:127:67: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
   result.stats.blocks_in_double_indirect * result.stats.block_size);
                                                                   ^

Should be corrected with defines like B_PRI* from ../headers/os/support/SupportDefs.h or FSSH_B_PRI* from ../headers/private/fs_shell/fssh_types.h

Attachments (1)

FIX-12957.patch (2.3 KB) - added by spitaels 3 years ago.
fix the 64-bit type printf misalignment

Download all attachments as: .zip

Change History (6)

comment:1 Changed 3 years ago by kallisti5

Owner: changed from axeld to nobody
Status: newassigned

comment:2 Changed 3 years ago by pulkomandy

Summary: [easy] 64-bit type printf misalignment(easy) 64-bit type printf misalignment

comment:3 Changed 3 years ago by spitaels

Has a Patch: set

Changed 3 years ago by spitaels

Attachment: FIX-12957.patch added

fix the 64-bit type printf misalignment

comment:4 Changed 3 years ago by korli

To anybody applying this patch, please check on 32-bit and 64-bit host and target platforms.

comment:5 Changed 2 years ago by axeld

Resolution: fixed
Status: assignedclosed

Fixed in hrev50884 - sorry, spitaels, I could not use your patch; within the fs-shell, command_checkfs.cpp must not use the B_PRI* macros, but the FSSH_B_PRI* macros. Thanks for your work, anyway, though!

Note: See TracTickets for help on using tickets.