Re: [PATCH 3/5] Fix weird quoting in stap-probe.c

Tom de Vries <[email protected]>
Newsgroups gmane.comp.gdb.patches
Message-ID <[email protected]>
On 8/23/26 6:31 AM, Eli Zaretskii wrote:
>> From: Tom Tromey <[email protected]>
>> Date: Sat, 22 Aug 2026 14:30:05 -0600
>> Cc: Tom Tromey <[email protected]>
>>
>> I found some code in stap-probe.c that split the quoting in a strange
>> way:
>>
>> 		warning (_("unrecognized bitness %s%c' for probe `%s'"),
>> 			 got_minus ? "`-" : "`", *cur,
>>
>> Here the leading ` is not part of the format string.  I found this odd
>> and so I split this fix out into its own patch.
> 
> This changes the quoting style of "-7" and the like.  As the test
> suite shows, it was previously quoted as `-7'.  Is there a good reason
> for this change? 

I googled this a bit, and came across ( 
https://www.gnu.org/prep/standards/html_node/Quote-Characters.html#Quote-Characters 
):
...
Although GNU programs traditionally used 0x60 (‘`’) for opening and 0x27 
(‘'’) for closing quotes, nowadays quotes ‘`like this'’ are typically 
rendered asymmetrically, so quoting ‘"like this"’ or ‘'like this'’ 
typically looks better.
...

> I'm not sure I understand what is weird about this
> quoting or ` not being part of the format string.  Is this just a
> style-preference thing?

If we'd leave the quoting style unchanged, I would have preferred:
...
warning (_("unrecognized bitness `%s%c' for probe `%s'"),
  	 got_minus ? "-" : "", *cur,
...
which I find easier to read.

Thanks,
- Tom
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.