Bug 6878 - '% found after symbol for non-H-TICK-HEX tokens
Summary: '% found after symbol for non-H-TICK-HEX tokens
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-11 12:35 UTC by Bernhard Reutner-Fischer
Modified: 2008-09-29 14:22 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
Only enable tick warning message when tick syntax is supported. Do not use a line number of 0 in warning messages (681 bytes, patch)
2008-09-18 07:52 UTC, Nick Clifton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard Reutner-Fischer 2008-09-11 12:35:23 UTC
Hi,
After this patch: http://sourceware.org/ml/binutils/2008-07/msg00244.html
as now complains about "'%" like below.
Furthermore, the locus of the warning seems to be incorrect, i would expect the
locus to point to line 8.

$ cat bar.s
	._XYZ'%eax = 3
	.macro arghh one
	.if 1 - \one
	pushl %ebx
	.endif
	.endm
	.text
	arghh ._XYZ'%eax
$ as-curr -o foo.o -Qy bar.s -v
GNU assembler version 2.18.50.0.9 (i386-linux-uclibc) using BFD version
(Linux/GNU Binutils) 2.18.50.0.9.20080822
bar.s: Assembler messages:
bar.s:0: Warning: '% found after symbol

works as expected with 2.18 and 2.18.50.0.8
Comment 1 Nick Clifton 2008-09-18 07:52:10 UTC
Created attachment 2956 [details]
Only enable tick warning message when tick syntax is supported.  Do not use a line number of 0 in warning messages
Comment 2 Nick Clifton 2008-09-18 07:54:38 UTC
Hi Bernhard,

  Please could you try out the uploaded patch.  I think that it will resolve the
issue for you.  It makes two changes - the warning message about the tick syntax
is now only issued if the target supports the syntax, and line numbers of 0 are
now ignored when displaying warning messages.  (There is no easy way to get an
accurate line number at the point where this warning message is generated, so I
elected to just suppress line numbers of 0).

Cheers
  Nick
Comment 3 Bernhard Reutner-Fischer 2008-09-18 16:13:36 UTC
The patch disables the warning for me, yes.
Shouldn't the warning only be issued if (the arch supports it and the param was
given and) "H'" was seen as opposed to any occurance of "'"?

thanks,
Comment 4 dj@redhat.com 2008-09-18 16:45:34 UTC
Subject: Re:  '% found after symbol for non-H-TICK-HEX tokens


The warning is for people who use the ' character without realizing
exactly how it will work.  It does not do what most people expect,
unless they've carefully read the documentation.  For example, the
string hello'there gets converted to hello116here, which is rarely
useful, and thus should generate a warning.

It's more useful like this:

	.byte	'h, 0x07, '$, 0x0a

Where there would be no warning anyway.

Ports that support h' hex use it like this:

	.byte	H'07, H'FE, H'0A
Comment 5 Nick Clifton 2008-09-29 14:22:10 UTC
Hi Guys,

  I have now checked my patch in together with this changelog entry.

Cheers
  Nick

gas/ChangeLog
        PR 6878
	* app.c (do_scrub_chars): Only issue warnings about tick
	characters detected in symbol strings if hex ticks are supported.