Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.utils.bug > #2266
| Path | csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail |
|---|---|
| From | johnny dude <johnny.dude@gmail.com> |
| Newsgroups | gnu.utils.bug |
| Subject | Re: Bug in the linker |
| Date | Wed, 21 Aug 2019 19:43:25 +0300 |
| Lines | 36 |
| Approved | bug-gnu-utils@gnu.org |
| Message-ID | <mailman.606.1566405819.30381.bug-gnu-utils@gnu.org> (permalink) |
| References | <CAKSZggjeNyRv_f+Wc_E4VpnQSZCKsQi8LgxmzMBbDzwJE2vDBA@mail.gmail.com> <mvmpnkyip9e.fsf@linux-m68k.org> <CAKSZggg1Lk01bQ760WhYikm9=a3OBXawwaQYF7+p7aAeddvi8A@mail.gmail.com> |
| NNTP-Posting-Host | lists.gnu.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="UTF-8" |
| X-Trace | usenet.stanford.edu 1566405820 27664 209.51.188.17 (21 Aug 2019 16:43:40 GMT) |
| X-Complaints-To | action@cs.stanford.edu |
| Cc | bug-gnu-utils@gnu.org |
| To | Andreas Schwab <schwab@linux-m68k.org> |
| Envelope-to | bug-gnu-utils@gnu.org |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3orYumaPMqLhwPMfW2vYT0jKSLcAbbDoRFBx7+2yeb0=; b=So/+SAtSV8Iish7mkIeTsogn0D8+zVUJr4tTAjkoYYKpX0Xlk5jSx0UPJf1D4slw3d lVRJ3ViJ+PIFL1xDBFs7FGYNLIj8IcWdjdqIrWZgDVAwg5UVUz4BNS0n/Bz2MHNtSHxw CxRVi0apfmfdUfKbFtwL6oyS1m8kJVieYxnkQ8XxsdBQUcdvRkKzDzys5mNMuQEBTzmi hGdA+79V6lmALjA6bJRwOcsYVFPHlzjv+0R0pbeZfSQAejx9ZzEBJi0RTjlDLCTQiiaS oYY+PSLmGPIwxQekhHElS2n5lWuv6iLEFX0l3Ju27sMc28yvkdFOu8CSaeeaajZvHs8M DQfg== |
| X-Google-DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3orYumaPMqLhwPMfW2vYT0jKSLcAbbDoRFBx7+2yeb0=; b=gn5M4q0hALkHFxZ5EeqMiyEUsZdPCUlCiHEgQFxPZs7mpV6o1r7Sig480/QtRVmHyM HJdjzAnJ6p55TX1NVmjSlGJmzmjjlTCXzIA5MGz/+A/W/WvkWT6VgInOIhSUlToHKs24 JirLId+r+X/YucJ3nGCJCQDxxpqhbvMo5ArVopnKpJA87gQLO1+BHtNdfg/YdQEJuEs9 3z6DEThNNKTVuEfapauFFiWWgNZBCmfBf6GVv4/ClzwTXApfZd1EGwJvblL65eGeeANw UYmS5D08zvGoctytemgcAZ5VuzDgcWp0iw2R7Ybtcz7wItdNpmu5QXX4EwBTf24zd+SH hRLw== |
| X-Gm-Message-State | APjAAAW9SZFMOpjoymlfEkVMpnfF+fNnE3ZOL4KAwlMoVmk5B6YS4IYq OGoHrcGJv5QbdDxaTCbYr5DasbNkxDV2UoQWWFai3w== |
| X-Google-Smtp-Source | APXvYqzhjr6DRgaEbPPDDX39ikm4pfDpqYeAKX93eZtTV99FfMCPpVYcFfQMIIwPmCevQKpiTDxNQFozWJfr5Fpxd+E= |
| X-Received | by 2002:ac2:5194:: with SMTP id u20mr19157454lfi.40.1566405813787; Wed, 21 Aug 2019 09:43:33 -0700 (PDT) |
| In-Reply-To | <mvmpnkyip9e.fsf@linux-m68k.org> |
| X-detected-operating-system | by eggs.gnu.org: Genre and OS details not recognized. |
| X-Received-From | 2a00:1450:4864:20::12a |
| X-Content-Filtered-By | Mailman/MimeDel 2.1.23 |
| X-BeenThere | bug-gnu-utils@gnu.org |
| X-Mailman-Version | 2.1.23 |
| Precedence | list |
| List-Id | Bug reports for the GNU utilities <bug-gnu-utils.gnu.org> |
| List-Unsubscribe | <https://lists.gnu.org/mailman/options/bug-gnu-utils>, <mailto:bug-gnu-utils-request@gnu.org?subject=unsubscribe> |
| List-Archive | <https://lists.gnu.org/archive/html/bug-gnu-utils> |
| List-Post | <mailto:bug-gnu-utils@gnu.org> |
| List-Help | <mailto:bug-gnu-utils-request@gnu.org?subject=help> |
| List-Subscribe | <https://lists.gnu.org/mailman/listinfo/bug-gnu-utils>, <mailto:bug-gnu-utils-request@gnu.org?subject=subscribe> |
| X-Mailman-Original-Message-ID | <CAKSZggg1Lk01bQ760WhYikm9=a3OBXawwaQYF7+p7aAeddvi8A@mail.gmail.com> |
| X-Mailman-Original-References | <CAKSZggjeNyRv_f+Wc_E4VpnQSZCKsQi8LgxmzMBbDzwJE2vDBA@mail.gmail.com> <mvmpnkyip9e.fsf@linux-m68k.org> |
| Xref | csiph.com gnu.utils.bug:2266 |
Show key headers only | View raw
Thank you for the quick response.
I understand the violation.
In all other cases ld returns an error of: "multiple definitions".
Including the same code, with the constructor defined outside the struct
declaration.
I thought it might be an implementation detail.
On Wed, Aug 21, 2019 at 5:09 PM Andreas Schwab <schwab@linux-m68k.org>
wrote:
> On Aug 21 2019, johnny dude <johnny.dude@gmail.com> wrote:
>
> > root@44027fc60f45:/# cat a.cpp
> > #include <iostream>
> > struct A { int n; A(int n) : n(n + 10) {} };
> > int a(int n) { return A(n).n; }
> > extern int b(int n);
> > int main(int, char**) { std::clog << a(5) << ", " << b(5) << "\n"; }
> >
> > root@44027fc60f45:/# cat b.cpp
> > #include <iostream>
> > struct A { int n; A(int n) : n(n + 100) {} };
> > int b(int n) { return A(n).n; }
>
> This violates basic.def.odr.
>
> Andreas.
>
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
> "And now for something completely different."
>
Back to gnu.utils.bug | Previous | Next | Find similar
Re: Bug in the linker johnny dude <johnny.dude@gmail.com> - 2019-08-21 19:43 +0300
csiph-web