summaryrefslogtreecommitdiff
path: root/gcc/xcoffout.c
diff options
context:
space:
mode:
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-13 19:44:03 +0000
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-13 19:44:03 +0000
commitc5b4d5f379a38426739964f18b4f21b955849977 (patch)
treec47272d6b31ce804b8376821ad0f84e9fe0e513b /gcc/xcoffout.c
parentcefc6ee27d5ecce9e3853576ff4d4b2868705d6a (diff)
downloadgcc-c5b4d5f379a38426739964f18b4f21b955849977.tar.gz
* xcoffout.c (xcoffout_declare_function): Always strip storage
class encoding. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92101 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/xcoffout.c')
-rw-r--r--gcc/xcoffout.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/gcc/xcoffout.c b/gcc/xcoffout.c
index f79755a58a8..a2d8a33ba5f 100644
--- a/gcc/xcoffout.c
+++ b/gcc/xcoffout.c
@@ -405,22 +405,18 @@ xcoffout_end_block (unsigned int line, unsigned int n)
void
xcoffout_declare_function (FILE *file, tree decl, const char *name)
{
- int i;
+ size_t len;
if (*name == '*')
name++;
- else
- for (i = 0; name[i]; ++i)
- {
- if (name[i] == '[')
- {
- char *n = alloca (i + 1);
- strncpy (n, name, i);
- n[i] = '\0';
- name = n;
- break;
- }
- }
+ len = strlen (name);
+ if (name[len - 1] == ']')
+ {
+ char *n = alloca (len - 3);
+ strncpy (n, name, len - 4);
+ n[len - 4] = '\0';
+ name = n;
+ }
/* Any pending .bi or .ei must occur before the .function pseudo op.
Otherwise debuggers will think that the function is in the previous