Click here to Skip to main content
15,881,859 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
honey the codewitch17-Sep-22 15:25
mvahoney the codewitch17-Sep-22 15:25 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
Randor 17-Sep-22 16:47
professional Randor 17-Sep-22 16:47 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
honey the codewitch17-Sep-22 16:57
mvahoney the codewitch17-Sep-22 16:57 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
Randor 17-Sep-22 17:06
professional Randor 17-Sep-22 17:06 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
honey the codewitch17-Sep-22 17:20
mvahoney the codewitch17-Sep-22 17:20 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
Randor 17-Sep-22 17:30
professional Randor 17-Sep-22 17:30 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
honey the codewitch17-Sep-22 22:20
mvahoney the codewitch17-Sep-22 22:20 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
k505418-Sep-22 5:04
mvek505418-Sep-22 5:04 
What release of gcc/clang are you using? According to Compiler Explorer I get the following with clang 5.0 with -O1 -std=C++17:
ASM
main:                                   # @main
        push    rax
        mov     edi, .L.str
        mov     esi, 65
        xor     eax, eax
        call    printf
        mov     edi, .L.str
        mov     esi, 65
        xor     eax, eax
        call    printf
        xor     eax, eax
        pop     rcx
        ret
.L.str:
        .asciz  "%c\n"
And x86-64 gcc 5.1 with the same flags gives:
ASM
.LC0:
        .string "%c\n"
main:
        sub     rsp, 8
        mov     esi, 65
        mov     edi, OFFSET FLAT:.LC0
        mov     eax, 0
        call    printf
        mov     esi, 65
        mov     edi, OFFSET FLAT:.LC0
        mov     eax, 0
        call    printf
        mov     eax, 0
        add     rsp, 8
        ret
Those are both pretty old compilers - the first of their lines to support C++17 AFAICT. Both produce the same code for each call. So maybe something in the compiler flags you're passing?
Keep Calm and Carry On

GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
honey the codewitch18-Sep-22 5:10
mvahoney the codewitch18-Sep-22 5:10 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
k505418-Sep-22 5:51
mvek505418-Sep-22 5:51 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
honey the codewitch18-Sep-22 6:01
mvahoney the codewitch18-Sep-22 6:01 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
CPallini18-Sep-22 20:48
mveCPallini18-Sep-22 20:48 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
honey the codewitch17-Sep-22 22:23
mvahoney the codewitch17-Sep-22 22:23 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
Randor 18-Sep-22 1:23
professional Randor 18-Sep-22 1:23 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
honey the codewitch18-Sep-22 1:28
mvahoney the codewitch18-Sep-22 1:28 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
Randor 18-Sep-22 1:56
professional Randor 18-Sep-22 1:56 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
honey the codewitch18-Sep-22 5:16
mvahoney the codewitch18-Sep-22 5:16 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
Randor 18-Sep-22 6:02
professional Randor 18-Sep-22 6:02 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
honey the codewitch18-Sep-22 6:03
mvahoney the codewitch18-Sep-22 6:03 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
honey the codewitch18-Sep-22 6:20
mvahoney the codewitch18-Sep-22 6:20 
PraiseRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
Randor 18-Sep-22 6:46
professional Randor 18-Sep-22 6:46 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
honey the codewitch18-Sep-22 6:53
mvahoney the codewitch18-Sep-22 6:53 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
Randor 18-Sep-22 6:55
professional Randor 18-Sep-22 6:55 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
honey the codewitch18-Sep-22 6:59
mvahoney the codewitch18-Sep-22 6:59 
GeneralRe: I thought I new C++ *sob* It has been inserting extra code on me this whole time. Pin
Randor 18-Sep-22 2:35
professional Randor 18-Sep-22 2:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.