scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit a91df650f66991aa8e2105cfa6a1a421bd1167fa
parent fa9848fffc5c946ad4ac9ab75cc42dfeab47b0fb
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 12 Mar 2018 19:26:04 +0100

[nm] Considerer U symbols always smallers

This is only intended to provided a beatifull list when -v is used.

Diffstat:
Mnm/main.c | 17++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/nm/main.c b/nm/main.c @@ -169,10 +169,21 @@ cmp(const void *p1, const void *p2) { const struct symbol *s1 = p1, *s2 = p2; - if (vflag) - return s1->value - s2->value; - else + if (vflag) { + if (s1->value > s2->value) + return 1; + if (s1->value < s2->value) + return -1; + if (s1->type == 'U' && s2->type == 'U') + return 0; + if (s1->type == 'U') + return -1; + if (s2->type == 'U') + return 1; + return 0; + } else { return strcmp(s1->name, s2->name); + } } void