Forum > Options
[SOLVED] How to hide "pointer not aligned in 'xyz'" in Messages window
Hansaplast:
Running Lazarus 4.99 (rev main_4_99-3421-g449b0a887c) FPC 3.3.1 x86_64-darwin-cocoa, but this is not specific for this version, and am getting tons (37000+) warnings that pointers are not aligned.
This probably has a good reason since I build with the latest Cocoa SDK.
That aside, how can I hide these messages in the "Messages" window?
Example:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Warning: ld: warning: pointer not aligned in '_RTTI_$COCOAGDIOBJECTS_$$_TCOCOASTATDASHES'+0x1A (/Users/hans/lazarus/lazarus/lcl/units/x86_64-darwin/cocoa/cocoagdiobjects.o)Warning: ld: warning: pointer not aligned in '_RTTI_$COCOAGDIOBJECTS_$$_TCOCOASTATDASHES'+0x2A (/Users/hans/lazarus/lazarus/lcl/units/x86_64-darwin/cocoa/cocoagdiobjects.o)Warning: ld: warning: pointer not aligned in '_RTTI_$COCOAGDIOBJECTS_$$_TCOCOASTATDASHES'+0x3A (/Users/hans/lazarus/lazarus/lcl/units/x86_64-darwin/cocoa/cocoagdiobjects.o)Warning: ld: warning: pointer not aligned in '_RTTI_$COCOAGDIOBJECTS_$$_PCOCOASTATDASHES'+0x1A (/Users/hans/lazarus/lazarus/lcl/units/x86_64-darwin/cocoa/cocoagdiobjects.o)Warning: ld: warning: pointer not aligned in '_RTTI_$COCOAGDIOBJECTS_$$_TCOCOADASHES'+0x1E (/Users/hans/lazarus/lazarus/lcl/units/x86_64-darwin/cocoa/cocoagdiobjects.o)Warning: ld: warning: pointer not aligned in '_INIT_$COCOAGDIOBJECTS_$$_TCOCOAPEN'+0x33 (/Users/hans/lazarus/lazarus/lcl/units/x86_64-darwin/cocoa/cocoagdiobjects.o)Warning: ld: warning: pointer not aligned in '_RTTI_$COCOAGDIOBJECTS_$$_TCOCOAPEN'+0x13 (/Users/hans/lazarus/lazarus/lcl/units/x86_64-darwin/cocoa/cocoagdiobjects.o)
Thaddy:
You can hide them with the proper alignment settings in the code: in this case 16 or 32. That will also fix them.
To be sure, both {$align 16} and {$codealign proc=16}.
This is not a linker issue, but a code issue. The linker merely detects the alignment is wrong. Which means your code is either inefficient or won't work.
On Apple M<x> hardware (aarch64) it is merely inefficient. On Apple Intel it would likely crash.
The default proc alignment for fpc is sizeof(pointer) which on Apple M<x> is 8 I believe.
See the manual:
https://www.freepascal.org/docs-html/current/prog/progsu9.html#x16-150001.2.9
Hansaplast:
Thanks Thaddy for the insight! It is very helpful, and ... learning something new every day 😉
I tried adding this to the compiler options, but it didn't make a difference.
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ----OaPROC=32-OaJUMP=32(also tried 16 instead of 32)
It affects all unit (FPC, Lazarus, components and my own units), so adding the {$align} option to each and every unit seems a little much. 😉
Maybe I should do a rebuild in FPCUpDeluxe with these options?
Or would these compiler options not help?
FYI: I'm compiling with an x86_64 compiler on a Apple Silicon Mac. The applications run just fine though, even when I cross compile to ARM.
marcov:
The warnings you show are about code alignement, not data alignment; look up $packrecords, or simply remove old "packed" before record on non 32-bit x86.
Hansaplast:
Thanks Marcov for chiming in. 😊
I do not use $packrecords, and ... it affects literally everything that is being compiled (FPC units, Lazarus units, and my own units).
I'm 100% sure this is triggered by me using "-WM15.0" to make sure the 15.0 SDK is being used.
Is there any way to mute linker messages (even though that is not the best idea)?
Navigation
[0] Message Index
[#] Next page