www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Patch] phobos: replaced printf with writef

reply "Thomas Kuehne" <eisvogel users.sourceforge.net> writes:
Replaced printf with writef in the release code of phobos. Most unittests
still remain to be converted.

Note: if you haven't applied the patch from digitalmars.com
digitalmars.D.bugs:2025 you'll have to fix some chunks(missing "private"
keyword).

Thomas


begin 666 phobos__substitute_printf_with_writef.diff
M9&EF9B M=7( 9&UD+W-R8R]P:&]B;W,O:6YT97)N86PO9&UA:6XR+F0 9&UD
M+W-R8R]P:&]B;W-?;F5U+VEN=&5R;F%L+V1M86EN,BYD"BTM+2!D;60O<W)C
M+W!H;V)O<R]I;G1E<FYA;"]D;6%I;C(N9 DR,# T+3$P+3 V(# R.C(P.C0T
M+C(V-SDT.#,U,B K,#(P, HK*RL 9&UD+W-R8R]P:&]B;W-?;F5U+VEN=&5R
M;F%L+V1M86EN,BYD"3(P,#0M,3 M,#8 ,#(Z,C4Z,3(N-3<R,34Y.3$R("LP
M,C P"D! ("TQ+#8 *S$L-B! 0 H #0H <')I=F%T92!I;7!O<G0 ;V)J96-T
M.PT*+7!R:79A=&4 :6UP;W)T('-T9"YC+G-T9&EO.PT**W!R:79A=&4 :6UP
M;W)T('-T9"YS=&1I;SL-"B!P<FEV871E(&EM<&]R="!S=&0N8RYS=&1L:6([
M#0H <')I=F%T92!I;7!O<G0 <W1D+G-T<FEN9SL-"B -"D! ("TV."PW("LV
M."PW($! "B  ("  ?0T*("  ("!C871C:" H3V)J96-T(&\I#0H ("  ('L-
M"BT)<')I;G1F*")%<G)O<CH (BD[#0HK"7=R:71E9B B17)R;W(Z("(I.PT*
M( EO+G!R:6YT*"D[#0H "7)E<W5L=" ]($58251?1D%)3%5213L-"B  ("  
M?0T*3G5R(&EN(&1M9"]S<F,O<&AO8F]S7VYE=2]I;G1E<FYA;#H 9&UA:6XR
M+F1^+ ID:69F("UU<B!D;60O<W)C+W!H;V)O<R]I;G1E<FYA;"]O8FIE8W0N
M9"!D;60O<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H17)R;W( 92D-"B )>PT*0$  +3,R-RPW("LS,C L-R! 
M0 H #0H =6YI='1E<W0-"B![#0HM("  (&1E8G5G*&-O;G8I('!R:6YT9B B
M8V]N=BYT;TQO;F<N=6YI='1E<W1<;B(I.PT**R  ("!D96)U9RAC;VYV*2!W
M<FET968H(F-O;G8N=&],;VYG+G5N:71T97-T7&XB*3L-"B -"B  ("  ;&]N
M9R!I.PT*( T*0$  +3,X-"PW("LS.#4L-R! 0 H "71R>0T*( E[#0H "2  
M("!I(#T =&],;VYG*&5R<F]R<UMJ72D[#0HM"2  ("!P<FEN=&8H(FP /2 E
M9%QN(BP :2D[#0HK"2  ("!W<FET968H(FP /2 B+"!I+" B7&XB*3L-"B )
M?0T*( EC871C:" H17)R;W( 92D-"B )>PT*0$  +30S-BPW("LT,S<L-R! 
M0 H #0H =6YI='1E<W0-"B![#0HM("  (&1E8G5G*&-O;G8I('!R:6YT9B B
M8V]N=BYT;U5L;VYG+G5N:71T97-T7&XB*3L-"BL ("  9&5B=6<H8V]N=BD 
M=W)I=&5F*")C;VYV+G1O56QO;F<N=6YI='1E<W1<;B(I.PT*( T*("  ("!U
M;&]N9R!I.PT*( T*0$  +30X.2PW("LT.3 L-R! 0 H "71R>0T*( E[#0H 
M"2  ("!I(#T =&]5;&]N9RAE<G)O<G-;:ETI.PT*+0D ("  <')I;G1F*")I
M(#T )61<;B(L(&DI.PT**PD ("  =W)I=&5F*")I(#T (BP :2P (EQN(BD[
M#0H "7T-"B )8V%T8V  *$5R<F]R(&4I#0H "7L-"D! ("TU,C,L-R K-3(T
M+#< 0$ *( T*('5N:71T97-T#0H >PT*+2  ("!D96)U9RAC;VYV*2!P<FEN
M=&8H(F-O;G8N=&]3:&]R="YU;FET=&5S=%QN(BD[#0HK("  (&1E8G5G*&-O
M;G8I('=R:71E9B B8V]N=BYT;U-H;W)T+G5N:71T97-T7&XB*3L-"B -"B  
M("  <VAO<G0 :3L-"B -"D! ("TU-S0L-R K-3<U+#< 0$ *( ET<GD-"B )
M>PT*( D ("  :2 ]('1O4VAO<G0H97)R;W)S6VI=*3L-"BT)("  ('!R:6YT
M9B B:2 ]("5D7&XB+"!I*3L-"BL)("  ('=R:71E9B B:2 ]("5D7&XB+"!I
M*3L-"B )?0T*( EC871C:" H17)R;W( 92D-"B )>PT*0$  +38P."PW("LV
M,#DL-R! 0 H #0H =6YI='1E<W0-"B![#0HM("  (&1E8G5G*&-O;G8I('!R
M:6YT9B B8V]N=BYT;U5S:&]R="YU;FET=&5S=%QN(BD[#0HK("  (&1E8G5G
M*&-O;G8I('=R:71E9B B8V]N=BYT;U5S:&]R="YU;FET=&5S=%QN(BD[#0H 
M#0H ("  ('5S:&]R="!I.PT*( T*0$  +38U-"PW("LV-34L-R! 0 H "71R
M>0T*( E[#0H "2  ("!I(#T =&]5<VAO<G0H97)R;W)S6VI=*3L-"BT)("  
M('!R:6YT9B B:2 ]("5D7&XB+"!I*3L-"BL)("  ('=R:71E9B B:2 ]("5D
M7&XB+"!I*3L-"B )?0T*( EC871C:" H17)R;W( 92D-"B )>PT*0$  +38X
M."PW("LV.#DL-R! 0 H #0H =6YI='1E<W0-"B![#0HM("  (&1E8G5G*&-O
M;G8I('!R:6YT9B B8V]N=BYT;T)Y=&4N=6YI='1E<W1<;B(I.PT**R  ("!D
M96)U9RAC;VYV*2!W<FET968H(F-O;G8N=&]">71E+G5N:71T97-T7&XB*3L-
M"B -"B  ("  8GET92!I.PT*( T*0$  +3<S.2PW("LW-# L-R! 0 H "71R
M>0T*( E[#0H "2  ("!I(#T =&]">71E*&5R<F]R<UMJ72D[#0HM"2  ("!P
M<FEN=&8H(FD /2 E9%QN(BP :2D[#0HK"2  ("!W<FET968H(FD /2 B+"!I
M+" B7&XB*3L-"B )?0T*( EC871C:" H17)R;W( 92D-"B )>PT*0$  +3<W
M,RPW("LW-S0L-R! 0 H #0H =6YI='1E<W0-"B![#0HM("  (&1E8G5G*&-O
M;G8I('!R:6YT9B B8V]N=BYT;U5B>71E+G5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-U;'0[#0H ("  ('T-"D! ("TR.#8L-R K,C X+#< 0$ *
M( E4:')E860 =" ](&-A<W0H5&AR96%D*7 [#0H "6EN="!R97-U;'0[#0H 
M#0HM"61E8G5G("AT:')E860I('!R:6YT9B B4W1A<G1I;F< =&AR96%D("5D
M7&XB+"!T+FED>"D[#0HK"61E8G5G("AT:')E860I('=R:71E9B B4W1A<G1I
M;F< =&AR96%D("(L('0N:61X+" B7&XB*3L-"B )="YS=&%C:T)O='1O;2 ]
M(&]S7W%U97)Y7W-T86-K0F]T=&]M*"D[#0H "71R>0T*( E[#0I 0" M,CDT
M+#$R("LR.38L,3( 0$ *( E]#0H "6-A=&-H("A/8FIE8W0 ;RD-"B )>PT*
M+0D ("  <')I;G1F*")%<G)O<CH (BD[#0HK"2  ("!W<FET968H(D5R<F]R
M.B B*3L-"B )("  (&\N<')I;G0H*3L-"B )("  (')E<W5L=" ](#$[#0H 
M"7T-"B -"BT)9&5B=6< *'1H<F5A9"D <')I;G1F*")%;F1I;F< =&AR96%D
M("5D7&XB+"!T+FED>"D[#0HK"61E8G5G("AT:')E860I('=R:71E9B B16YD
M:6YG('1H<F5A9" B+"!T+FED>"P (EQN(BD[#0H "70N<W1A=&4 /2!44RY4
M15)-24Y!5$5$.PT*( EA;&Q4:')E861S6W0N:61X72 ](&YU;&P[#0H "70N
M:61X(#T +3$[#0I 0" M-C$U+#< *S8Q-RPW($! "B )"7T-"B )("  ('T-
M"B )?0T*+0EP<FEN=&8H(F1I9&XG="!F:6YD(&ET7&XB*3L-"BL)=W)I=&5F
M*")D:61N)W0 9FEN9"!I=%QN(BD[#0H "6%S<V5R="AR97-U;'0I.PT*( ER
M971U<FX <F5S=6QT.PT*("  ("!]#0I 0" M-S4P+#$R("LW-3(L,3( 0$ *
M( E]#0H "6-A=&-H("A/8FIE8W0 ;RD-"B )>PT*+0D ("  <')I;G1F*")%
M<G)O<CH (BD[#0HK"2  ("!W<FET968H(D5R<F]R.B B*3L-"B )("  (&\N
M<')I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+G)E=F5R<V4["0D)"2\O(&%D:0T*("  ("!A+G-O
M<G0["0D)"2\O('%S;W)T#0I 0" M-38L,3, *S4V+#$S($! "B![#0H ("  
M(&-R96%L(&, /2 S+C  *R T+C!I.PT*("  ("!C(#T <W%R="AC*3L-"BT 
M("  <')I;G1F*")R92 ]("5,9RP :6T /2 E3&=<;B(L(&,N<F4L(&,N:6TI
M.PT**R  ("!W<FET968H(G)E(#T (BP 8RYR92P (BP :6T /2 B+"!C+FEM
M+" B7&XB*3L-"B!]#0H #0HM("  ('!R:6YT9B B:&5L;&\ =V]R;&1<;B(I
M.PT*+2  ("!P<FEN=&8H(F%R9W,N;&5N9W1H(#T )61<;B(L(&%R9W,N;&5N
M9W1H*3L-"BL ("  =W)I=&5F*")H96QL;R!W;W)L9%QN(BD[#0HK("  ('=R
M:71E9B B87)G<RYL96YG=&  /2 B+"!A<F=S+FQE;F=T:"PB7&XB*3L-"B  
M("  9F]R("AI;G0 :2 ](# [(&D /"!A<F=S+FQE;F=T:#L :2LK*0T*+0EP
M<FEN=&8H(F%R9W-;)61=(#T )R5S)UQN(BP :2P 8V%S="AC:&%R("HI87)G
M<UMI72D[#0HM("  ('!R:6YT9B B4W5C8V5S<UQN(2(I.PT**PEW<FET968H
M(F%R9W-;(BQI+")=(#T (BQA<F=S6VE=+")<;B(I.PT**R  ("!W<FET968H
F(E-U8V-E<W-<;B%<;B(I.PT*("  ("!R971U<FX ,#L-"B!]#0H`
`
end
Oct 06 2004
parent reply Ben Hinkle <bhinkle4 juno.com> writes:
Thomas Kuehne wrote:

 Replaced printf with writef in the release code of phobos. Most unittests
 still remain to be converted.
 
 Note: if you haven't applied the patch from digitalmars.com
 digitalmars.D.bugs:2025 you'll have to fix some chunks(missing "private"
 keyword).
 
 Thomas
shouldn't writef(msg,"\n"); be writefln("",msg); otherwise the msg gets parsed as a format string.
Oct 06 2004
parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
Ben Hinkle wrote:

 Thomas Kuehne wrote:
 
 Replaced printf with writef in the release code of phobos. Most 
 unittests still remain to be converted.
 
 Note: if you haven't applied the patch from digitalmars.com 
 digitalmars.D.bugs:2025 you'll have to fix some chunks(missing 
 "private" keyword).
 
 Thomas
shouldn't writef(msg,"\n"); be writefln("",msg); otherwise the msg gets parsed as a format string.
What's wrong with writefln(msg); ? Stewart.
Oct 06 2004
next sibling parent Ben Hinkle <bhinkle4 juno.com> writes:
Stewart Gordon wrote:

 Ben Hinkle wrote:
 
 Thomas Kuehne wrote:
 
 Replaced printf with writef in the release code of phobos. Most
 unittests still remain to be converted.
 
 Note: if you haven't applied the patch from digitalmars.com
 digitalmars.D.bugs:2025 you'll have to fix some chunks(missing
 "private" keyword).
 
 Thomas
shouldn't writef(msg,"\n"); be writefln("",msg); otherwise the msg gets parsed as a format string.
What's wrong with writefln(msg); ? Stewart.
I haven't actually tried it but yeah that might work as long as there aren't any parameters. I don't know if writef errors when it sees writef("%s") with an error saying not enough parameters or if it prints the string "%s". To be consistent it should error but I don't know what it actually does. -Ben
Oct 06 2004
prev sibling next sibling parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
Stewart Gordon wrote:

<snip>
 shouldn't
  writef(msg,"\n");
 be
  writefln("",msg);
 otherwise the msg gets parsed as a format string.
What's wrong with writefln(msg);
Oops, that wasn't what I meant to say. You misunderstand how writef works. Unlike printf, writef doesn't just take its first argument to be a format string. Instead, it takes the first string it encounters to be a format string. It then reads as many arguments as the format string specifies. After it has done this, it reads subsequent argument strings in the same way, which may include another format string. And so either writefln("", msg); or writefln(msg); will cause msg to be interpreted as a format string. OTOH, if you write writefln("%s", msg); then msg is a field of the format string "%s". Hence msg will not be parsed as a format string. Stewart.
Oct 06 2004
parent "Thomas Kuehne" <eisvogel users.sourceforge.net> writes:
Stewart Gordon schrieb:
 Instead, it takes the first string it encounters to be a format string.
   It then reads as many arguments as the format string specifies.  After
 it has done this, it reads subsequent argument strings in the same way,
 which may include another format string.

 And so either

      writefln("", msg);

 or

      writefln(msg);

 will cause msg to be interpreted as a format string.  OTOH, if you write

      writefln("%s", msg);

 then msg is a field of the format string "%s".  Hence msg will not be
 parsed as a format string.
I forgot that :O Thomas
Oct 07 2004
prev sibling parent Derek <derek psyc.ward> writes:
On Wed, 06 Oct 2004 13:08:48 +0100, Stewart Gordon wrote:

 Ben Hinkle wrote:
 
 Thomas Kuehne wrote:
 
 Replaced printf with writef in the release code of phobos. Most 
 unittests still remain to be converted.
 
 Note: if you haven't applied the patch from digitalmars.com 
 digitalmars.D.bugs:2025 you'll have to fix some chunks(missing 
 "private" keyword).
 
 Thomas
shouldn't writef(msg,"\n"); be writefln("",msg); otherwise the msg gets parsed as a format string.
What's wrong with writefln(msg); ? Stewart.
The first parameter is supposed to be a template or pattern, thus if 'msg' just happens to contain formatting codes, the application may abort. It is safer to do ... writefln("%s", msg); I tested 'writefln("%s")' and I got the error message "Error: std.format". -- Derek Melbourne, Australia
Oct 06 2004