Skip to content

Commit

Permalink
warn about hh/ll modifier (if not supported)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksherlock committed Mar 23, 2018
1 parent 1943c99 commit 7e6b433
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions Printf.pas
Expand Up @@ -298,11 +298,11 @@ procedure FormatCheck{fmt: fmt_type; args: fmtArgPtr};
case c of
'h': begin
has_length := h;
if feature_hh then state := st_length_h;
state := st_length_h;
end;
'l': begin
has_length := l;
if feature_ll then state := st_length_l;
state := st_length_l;
end;
'j': has_length := j;
'z': has_length := z;
Expand Down Expand Up @@ -463,13 +463,15 @@ procedure FormatCheck{fmt: fmt_type; args: fmtArgPtr};
if c = 'h' then begin
has_length := hh;
state := st_format;
if not feature_hh then Warning(@'hh modifier not currently supported');
end else do_scanf_format;

st_length_l: { l? format }
if c = 'l' then begin
has_length := ll;
state := st_format;
end else do_scanf_format;
if not feature_ll then Warning(@'ll modifier not currently supported');
end else do_scanf_format;

st_format: { format }
do_scanf_format;
Expand Down Expand Up @@ -642,11 +644,19 @@ procedure FormatCheck{fmt: fmt_type; args: fmtArgPtr};
else do_printf_format;

st_length_h: { h? format }
if c = 'h' then begin has_length := hh; state := st_format; end
if c = 'h' then begin
has_length := hh;
state := st_format;
if not feature_hh then Warning(@'hh modifier not currently supported');
end
else do_printf_format;

st_length_l: { l? format}
if c = 'l' then begin has_length := ll; state := st_format; end
if c = 'l' then begin
has_length := ll;
state := st_format;
if not feature_ll then Warning(@'ll modifier not currently supported');
end
else do_printf_format;

st_format: do_printf_format;
Expand Down

0 comments on commit 7e6b433

Please sign in to comment.