All,
This is a very strange circumstance. dumping C++ to assembler *without*
optimization produces file previewed as plain-text in konqueror file preview.
E.g. files created with:
g++ -S -masm=intel -O0 -std=c++17 -o asm/findhyphen-0-cstr.asm findhyphen.cpp
The preview for file findhyphen-0-cstr.asm is shown as plain text with
proper syntax highlight in konqueror.
However if you use any optimization, e.g. -O1 through -Ofast the file is
recognized as "Unknown" in konqueror and previews as hex instead of
plain-text. The compile string would be:
g++ -S -masm=intel -O1 -std=c++17 -o asm/findhyphen-1-cstr.asm findhyphen.cpp
In konqueror preview, the first line is shown in the hex preview as:
0000:0000 | 09 2E 66 69 6C 65 09 22 66 69 6E 64 68 79 70 68 |
..file."findhyph
(which is all valid plain-text as is the rest of the file)
All editors (including kwrite and kate) open the text as a proper
plain-text assembler file with proper highlight in contrast to what konqueror
preview shows. I never recall this happening before. All file utilities see
nothing but plain-text as well, e.g.
$ file findhyphen-1-cstr.asm
findhyphen-1-cstr.asm: assembler source, ASCII text
or
$ head -n 5 findhyphen-1-cstr.asm
.file "findhyphen.cpp"
.intel_syntax noprefix
.text
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
I can't explain any possible reason why konqueror preview choose "Unknown"
type for findhyphen-1-cstr.asm and plain-text for findhyphen-0-cstr.asm, but
something is wrong. I'll try attaching the text file here.
--
David C. Rankin, J.D.,P.E.