Bug 49180 - incorrect output with -i flag
Summary: incorrect output with -i flag
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: xxd (show other bugs)
Version: unstable
Hardware: all Linux
: P5 normal
Assignee: Gleb F-Malinovskiy
QA Contact: qa-sisyphus
URL: https://github.com/vim/vim/issues/13876
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-25 12:41 MSK by Sergey Bolshakov
Modified: 2024-01-25 18:03 MSK (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Bolshakov 2024-01-25 12:41:27 MSK
$ date > file  
$ rpmquery xxd
xxd-9.0.2136-alt1.aarch64
$ xxd -i file 
unsigned char file[] = {
  0x54, 0x68, 0x75, 0x20, 0x4a, 0x61, 0x6e, 0x20, 0x32, 0x35, 0x20, 0x31,
  0x32, 0x3a, 0x33, 0x31, 0x3a, 0x30, 0x33, 0x20, 0x4d, 0x53, 0x4b, 0x20,
  0x32, 0x30, 0x32, 0x34, 0x0a
};
unsigned int file_len = 29;

(обновляемся ...)

$ rpmquery xxd            
xxd-9.1.0050-alt1.aarch64
$ xxd -i file 
unsigned char file[] = {
  0x54, 0x68, 0x75, 0x20, 0x4a, 0x61, 0x6e, 0x20, 0x32, 0x35, 0x20, 0x31,
  0x32, 0x3a, 0x33, 0x31, 0x3a, 0x30, 0x33, 0x20, 0x4d, 0x53, 0x4b, 0x20,
  0x32, 0x30, 0x32, 0x34, 0x0a
};
size_t file_len = 29;

как видно, file_len из unsigned_int стал size_t -- без включения stddef.h,
и компиляция такого сгенерированного файла заканчивается неудачей.
Comment 1 Repository Robot 2024-01-25 18:03:51 MSK
vim-4:9.1.0050-alt2 -> sisyphus:

 Thu Jan 25 2024 Gleb F-Malinovskiy <glebfm@altlinux> 4:9.1.0050-alt2
 - Reverted upstream commit "patch 9.1.0041: xxd -i may generate incorrect C
   statements" to fix regression in xxd -i output (ALT#49180).