Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Find printf in u-boot to print 64-bit integer variables.
Find printf in u-boot to print 64-bit integer variables.
1。 After reading the code, is this the va_arg(args, unsigned long long) you said: in lib _ generic/vsprintf.c: int vsprintf (char * buf, constchar * fmt, Va _ listargs) {... # ifdefconfig _ sys _ 64bit _ vsprintif (qualifier = =' q')/* "quad" for 64bit variable */ num = va_arg(args, unsigned long long); Else#endif...} If so, you should have added the corresponding macro to enable 64-bit support, right? I added: # definecong _ sys _ 64 bit _ vsprintf1# definecong _ sys _ 64bit _ stroul1in the header file, where config _ sys _ 64bit _ stroul1corresponds to cmd_nand.c, and lib _ is required. As for the compiler version, mine is the arm-linux-gcc configuration of GCC version 4.2.4 compiled with buildroot v2009.08, which adds support for large files: [*] Enable large file (files >; 2 GB) support? I wonder if this parameter has any influence on the compiler function that supports 64-bit printing. If there is, it should be added when compiling. 3。 Besides, I use OABI. If you use EABI, I wonder if it is possible that EABI is not compatible enough. (Personally, I think this possibility is extremely small. . .