class AdLint::Cc1::PrintfFormat::Conversion_c

Public Class Methods

suitable_conversion_specifier_character() click to toggle source
# File lib/adlint/cc1/format.rb, line 1267
def self.suitable_conversion_specifier_character
  "c"
end

Private Instance Methods

argument_types() click to toggle source
# File lib/adlint/cc1/format.rb, line 1276
def argument_types
  # NOTE: The ISO C99 standard says;
  #
  # 7.19.6.1 The fprintf function
  #
  # 7 The length modifiers and their meanings are:
  #
  #   l    Specifies that a following d, i, o, u, x, or X conversion
  #        specifier applies to a long int or unsigned long int argument;
  #        that a following n conversion specifier applies to a pointer
  #        to a long int argument; that a following c conversion
  #        specifier applies to a wint_t argument; that a following s
  #        conversion specifier applies to a pointer to a wchar_t
  #        argument; or has no effect on a following a, A, e, E, f, F, g,
  #        or G conversion specifier.
  case length_modifier
  when "l"
    # FIXME: `wint_t' is not supported yet.
    [wchar_t]
  else
    # NOTE: The argument will be integer promoted, so the argument type
    #       whose conversion-rank is less than one of the int should be
    #       acceptable, too.
    [signed_char_t, unsigned_char_t, signed_short_t,
      unsigned_short_t, signed_int_t, unsigned_int_t]
  end
end
default_precision_value() click to toggle source
# File lib/adlint/cc1/format.rb, line 1272
def default_precision_value
  0
end
suitable_length_modifiers() click to toggle source
# File lib/adlint/cc1/format.rb, line 1304
def suitable_length_modifiers
  ["l"]
end