public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Fangrui Song <i@maskray.me>
To: Nick Clifton <nickc@redhat.com>
Cc: Umesh Kalappa <umesh.kalappa0@gmail.com>,
	Binutils <binutils@sourceware.org>
Subject: Re: Linker diagnostics for the incorrect options .
Date: Thu, 1 Oct 2020 17:19:33 -0700	[thread overview]
Message-ID: <MWHPR12MB1456AD63235900E0CCFA32C9CB310@MWHPR12MB1456.namprd12.prod.outlook.com> (raw)
In-Reply-To: <af5dda68-3ecc-e794-f29b-295aa523bc69@redhat.com>

On Wed, Sep 23, 2020 at 2:31 AM Nick Clifton <nickc@redhat.com> wrote:
>
> Hi Fangrui,
>
> > This is a conflict between the grouped short options syntax and single
> > dash prefixed long options.
> >
> > % touch an ommand ':)'
> > % ld.bfd -you -can -ofcourse -use -this -Long -command -Line ':)'
> > :)
>
> he!
>
> > For newer long options, we should encourage EXACTLY_TWO_DASHES
>
> Definitely.
>
> > (ld/lexsup.c). I have not seen grouped short options in a very large
> > code base and FreeBSD.
> > Maybe we can deprecate grouped short options syntax for ld.
>
> I like this idea.  How about the attached patch ?  With it applied I
> get output like this:
>
>   % ld -vn -non-static -e 0 -v -e2 hello.o
>   GNU ld (GNU Binutils) 2.35.50.20200923
>   ld: Warning: grouped short command line options are deprecated: -vn
>   ld: Error: unable to disambiguate: -non-static (did you mean --non-static ?)
>
>   % echo $?
>   1
>
> Cheers
>   Nick

Thanks! Perhaps    ` && optind != last_optind /* It is not a repeat of
the previous option.  */` can be deleted... Nobody repeats a short
option for ld,
unless they want to have fun with:

% Debug/ld/ld-new -vvvvvv
GNU ld (GNU Binutils) 2.35.50.20201002
GNU ld (GNU Binutils) 2.35.50.20201002
GNU ld (GNU Binutils) 2.35.50.20201002
GNU ld (GNU Binutils) 2.35.50.20201002
GNU ld (GNU Binutils) 2.35.50.20201002
GNU ld (GNU Binutils) 2.35.50.20201002

  reply	other threads:[~2020-10-02  0:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-19  5:29 Umesh Kalappa
2020-09-22 12:31 ` Nick Clifton
2020-09-22 18:40   ` Fangrui Song
     [not found]   ` <MWHPR12MB14567F315D72755B1CC41210CB3B0@MWHPR12MB1456.namprd12.prod.outlook.com>
2020-09-23  9:31     ` Nick Clifton
2020-10-02  0:19       ` Fangrui Song [this message]
     [not found]       ` <MWHPR12MB145628F1D93CC392F9F8F1DECB310@MWHPR12MB1456.namprd12.prod.outlook.com>
2020-10-05 12:55         ` Nick Clifton
2020-12-11 10:25       ` Matthias Klose

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MWHPR12MB1456AD63235900E0CCFA32C9CB310@MWHPR12MB1456.namprd12.prod.outlook.com \
    --to=i@maskray.me \
    --cc=binutils@sourceware.org \
    --cc=nickc@redhat.com \
    --cc=umesh.kalappa0@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).