ruby-changes:43363
From: nobu <ko1@a...>
Date: Sat, 18 Jun 2016 11:25:31 +0900 (JST)
Subject: [ruby-changes:43363] nobu:r55437 (trunk): Suppress false warnings
nobu 2016-06-18 11:25:27 +0900 (Sat, 18 Jun 2016) New Revision: 55437 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55437 Log: Suppress false warnings * vsnprintf.c (BSD_vfprintf): make PRI_EXTRA_MARK_LEN an explicit int to suppress type-limits warnings by old gcc. Modified files: trunk/vsnprintf.c Index: vsnprintf.c =================================================================== --- vsnprintf.c (revision 55436) +++ vsnprintf.c (revision 55437) @@ -536,6 +536,9 @@ static int exponent(char *, int, int); https://github.com/ruby/ruby/blob/trunk/vsnprintf.c#L536 static ssize_t BSD_vfprintf(FILE *fp, const char *fmt0, va_list ap) { +#ifdef PRI_EXTRA_MARK + const int PRI_EXTRA_MARK_LEN = rb_strlen_lit(PRI_EXTRA_MARK); +#endif register const char *fmt; /* format string */ register int ch; /* character from fmt */ register int n; /* handy integer (short term usage) */ @@ -813,7 +816,6 @@ reswitch: switch (ch) { https://github.com/ruby/ruby/blob/trunk/vsnprintf.c#L816 # define INTPTR_FLAG 0 #endif #ifdef PRI_EXTRA_MARK -# define PRI_EXTRA_MARK_LEN (sizeof(PRI_EXTRA_MARK)-1) # define IS_PRI_EXTRA_MARK(s) \ (PRI_EXTRA_MARK_LEN < 1 || \ (*(s) == PRI_EXTRA_MARK[0] && \ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/