This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix print_char() bug on translate to C


Zhaolei <zhaolei@cn.fujitsu.com> writes:

> > [...]
> stap -e 'probe begin {print_char("a")}'

Is it necessary to make print_char polymorphic?  print("a") does the
same thing as that case.

(I had no idea we even had a "print_char" -- why on earth, considering
that we have printf("%c", number)...  Perhaps it should just get
deprecated.)


> +		  default:
> +		    // print '-' if type unknown(should not run to here)
> +		    o->line() << "'-');";
> +		    break;

>  	      else
> -		o->line() << '"' << format_string << "\");";
> +		// print '-' if no args(should not run to here because args are checked previously)
> +		o->line() << "'-');";

Such cases should just abort(), as they indicate translator internal
errors.

- FChE


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]