%PDF-1.4
%
1 0 obj
<<
/Type /Page
/Parent 9 0 R
/Resources 3 0 R
/Contents 2 0 R
>>
endobj
2 0 obj
<< /Length 4149 >>
stream
BT
/TT2 1 Tf
14 0 0 14 192.863 710.89 Tm
0 g
/GS1 gs
0 Tc
0 Tw
[(P)20(ortability in C -- A Case Study)]TJ
/TT4 1 Tf
12 0 0 12 258.498 682.89 Tm
(Matt Bishop)Tj
/TT6 1 Tf
-7.7905 -1.75 TD
[(Research Institute for Adv)25(anced Computer Science)]TJ
4.1985 -1.1667 TD
[(N)35(ASA Ames Research Center)]TJ
0.938 -1.1667 TD
[(Mof)25(fett Field, CA)-500(94035)]TJ
/TT2 1 Tf
2.399 -7.35 TD
[(Intr)18(oduction)]TJ
/TT6 1 Tf
-12.7865 -3.85 TD
0.1437 Tw
[(There are a lar)18(ge number of computers and operating systems in use today)65(,)-393.7(and)]TJ
-2.5 -1.1667 TD
0.1502 Tw
[(more and more programs are being mo)15(v)15(e)0(d)-400.3(from one computer or operating system to)]TJ
T*
0.0918 Tw
[(another)55(.)-591.8(I)0(n)-341.8(f)10(act, when you complete a program, your job is often only half done; since)]TJ
T*
0.046 Tw
[(you almost certainly ha)20(v)15(e)15( )-15(access to other computers, you will w)10(ant to mak)10(e)-296(the program)]TJ
T*
0.0112 Tw
[(portable enough to run on all of those machines.)-511.2(T)80(aking some care while writing the pro-)]TJ
T*
0 Tw
[(gram can greatly reduce, or e)25(v)15(en)-250(eliminate, the dif)]TJ
/TT7 1 Tf
20.0922 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
(culty of such ports.)Tj
-18.1484 -1.5167 TD
0.1999 Tw
[(In this article we will e)15(xamine se)25(v)15(eral C programming constructs that produce)]TJ
-2.5 -1.1667 TD
0.1262 Tw
[(more portable programs.)-626.2(W)80(e)80( )-80(will do this in three stages, looking )]TJ
/TT7 1 Tf
27.5798 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.1262 Tw
(rst at dependencies)Tj
-28.136 -1.1667 TD
0.0355 Tw
[(upon the compiler)40(,)-285.5(then at dependencies upon the operating system, and )]TJ
/TT7 1 Tf
29.4264 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0356 Tw
(nally at depen-)Tj
-29.9825 -1.1667 TD
0.156 Tw
[(dencies upon the computer architecture.)-656(Each of these considerations af)25(fects dif)25(ferent)]TJ
T*
0 Tw
(parts of the program.)Tj
2.5 -1.5167 TD
0.0402 Tw
[(The v)15(ehicle we shall use is a program called)]TJ
/TT4 1 Tf
18.3118 0 TD
0 Tw
(trnum)Tj
/TT6 1 Tf
2.3892 0 TD
0.0402 Tw
[(.)-540.2(This program is used to num-)]TJ
-23.201 -1.1667 TD
0.0192 Tw
[(ber equations, tables, and an)15(y)-269.2(other te)15(xt you lik)10(e; the numbers are gi)25(v)15(e)0(n)-269.2(t)0(o)]TJ
/TT4 1 Tf
30.2355 0 TD
0 Tw
(trnum)Tj
/TT6 1 Tf
2.6583 0 TD
0.0192 Tw
(as sym-)Tj
-32.8939 -1.1667 TD
0.0487 Tw
[(bols and are con)40(v)15(erted to numbers by that program.)-548.8(It w)10(as written before UNIX System)]TJ
T*
0.0803 Tw
[(V)-330.4(w)10(as a)20(v)25(ailable, and w)10(as ported to that operating system with literally no changes.)-580.3(So,)]TJ
T*
0.0132 Tw
[(the goal of programs which can be ported without changing an)15(ything is not an impossible)]TJ
T*
0 Tw
(dream.)Tj
/TT2 1 Tf
12.931 -3.5 TD
(Compiler Dependencies)Tj
/TT6 1 Tf
-10.431 -2.6833 TD
0.156 Tw
(Compilers which implement C as de)Tj
/TT7 1 Tf
15.3611 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.156 Tw
[(ned in )74(The C Programming Language --)]TJ
-18.4172 -1.1667 TD
0.1257 Tw
[(Reference Manual)74()-375.7(\(see)]TJ
/TT2 1 Tf
10.4358 0 TD
[(The C Pr)18(ogramming Language)]TJ
/TT6 1 Tf
14.0958 0 TD
[(by Brian W)92(.)-375.7(K)25(ernighan and)]TJ
-24.5317 -1.1667 TD
0.0188 Tw
(Dennis M. Ritchie, Prentice-Hall, Inc., 1978; the)Tj
/TT2 1 Tf
19.8495 0 TD
[(UNIX Pr)18(ogrammer)37(s)-268.7(Manual V)100(olume)]TJ
-19.8495 -1.1667 TD
0 Tw
(2)Tj
/TT6 1 Tf
0.8393 0 TD
0.0892 Tw
[(contains a short addendum\) are pretty much the same; only a fe)25(w)-339.3(features may cause)]TJ
-0.8393 -1.1667 TD
0.0022 Tw
[(problems. )-250.1(F)15(our are as a result of an e)15(xtension to the language in 1978 \(and co)15(v)15(ered in the)]TJ
T*
0.0727 Tw
(addendum to the reference manual\); the remaining one arises from ef)Tj
/TT7 1 Tf
28.3573 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
[(cienc)15(y)-322.8(considera-)]TJ
-28.9134 -1.1667 TD
0.0437 Tw
[(tions, and is e)15(xplicitly left unde)]TJ
/TT7 1 Tf
12.8122 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0437 Tw
[(ned in the reference manual.)-543.7(W)80(e)80( )-80(will deal )]TJ
/TT7 1 Tf
17.4832 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0437 Tw
(rst with the)Tj
ET
endstream
endobj
3 0 obj
<<
/ProcSet [ /PDF /Text ]
/Font << /TT2 4 0 R /TT4 5 0 R /TT6 6 0 R /TT7 7 0 R >>
/ExtGState << /GS1 8 0 R >>
>>
endobj
4 0 obj
<<
/Type /Font
/Subtype /TrueType
/FirstChar 32
/LastChar 146
/Widths [ 250 0 0 0 0 0 0 0 0 0 0 0 0 333 0 0 0 0 500 0 0 0 0 0 500 0 0 0 0
0 0 0 0 722 0 722 722 0 0 0 0 389 500 0 667 944 722 778 611 0 0
556 667 722 722 0 722 0 0 0 0 0 0 0 0 500 556 444 556 444 0 500
556 278 0 0 278 833 556 500 556 0 444 389 333 556 0 0 0 500 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 333 ]
/Encoding /WinAnsiEncoding
/BaseFont /OIHJBJ+Times-Bold
/FontDescriptor 39 0 R
>>
endobj
5 0 obj
<<
/Type /Font
/Subtype /TrueType
/FirstChar 32
/LastChar 121
/Widths [ 250 0 0 0 0 0 0 0 0 0 0 0 0 333 250 0 500 500 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 611 611 0 0 0 611 0 0 333 0 0 556 833 0 0 0 0 0 0 556
0 0 0 0 0 0 389 0 389 0 500 0 500 500 444 500 444 278 500 500 278
0 0 278 722 500 500 500 0 389 389 278 500 444 667 444 444 ]
/Encoding /WinAnsiEncoding
/BaseFont /Times-Italic
/FontDescriptor 41 0 R
>>
endobj
6 0 obj
<<
/Type /Font
/Subtype /TrueType
/FirstChar 32
/LastChar 152
/Widths [ 250 0 408 500 0 0 778 0 333 333 500 564 250 333 250 278 500 500 500
500 500 500 500 500 500 500 278 278 564 564 564 444 0 722 667 667
722 611 556 722 722 333 389 722 611 889 722 722 556 0 667 556 611
722 722 944 722 722 0 333 0 333 0 500 0 444 500 444 500 444 333
500 500 278 278 500 278 778 500 500 500 500 333 389 278 500 500
722 500 500 444 480 0 480 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
333 333 0 0 0 0 0 333 ]
/Encoding /WinAnsiEncoding
/BaseFont /OIHJGA+Times-Roman
/FontDescriptor 42 0 R
>>
endobj
7 0 obj
<<
/Type /Font
/Subtype /TrueType
/FirstChar 222
/LastChar 223
/Widths [ 556 556 ]
/Encoding /MacRomanEncoding
/BaseFont /OIHJKC+Times-Roman
/FontDescriptor 44 0 R
>>
endobj
8 0 obj
<<
/Type /ExtGState
/SA false
/SM 0.02
/OP false
/op false
/OPM 1
/BG2 /Default
/UCR2 /Default
/HT /Default
/TR2 /Default
>>
endobj
9 0 obj
<<
/Type /Pages
/Kids [ 1 0 R 10 0 R 14 0 R 17 0 R 21 0 R 24 0 R 27 0 R 31 0 R ]
/Count 8
/MediaBox [ 0 0 612 792 ]
>>
endobj
10 0 obj
<<
/Type /Page
/Parent 9 0 R
/Resources 12 0 R
/Contents 11 0 R
>>
endobj
11 0 obj
<< /Length 6758 >>
stream
BT
/TT6 1 Tf
12 0 0 12 72 791.89 Tm
0 g
/GS1 gs
0 Tc
0 Tw
[(The C Journal)-12084(2)-333( )-14111(8/5/104)]TJ
ET
BT
12 0 0 12 72 755.8901 Tm
[(e)15(xtensions.)]TJ
/TT4 1 Tf
2.5 -1.5167 TD
[(T)55(rnum)]TJ
/TT6 1 Tf
2.924 0 TD
0.0616 Tw
[(allo)25(ws the user to specify the format of the counter)40(,)-311.6(s)0(o)-311.6(i)0(t)-311.6(will be printed as)]TJ
-5.424 -1.1667 TD
0.2153 Tw
[(capital or small Arabic letters, Roman numerals, or numbers.)-715.3(These are represented)]TJ
T*
0.0318 Tw
(internally by the symbols)Tj
/TT4 1 Tf
10.515 0 TD
0 Tw
(F1)Tj
/TT6 1 Tf
1.3927 0 TD
0.0318 Tw
(\(for numbers\),)Tj
/TT4 1 Tf
6.0895 0 TD
-0.115 Tc
0 Tw
(FA)Tj
/TT6 1 Tf
1.3885 0 TD
0 Tc
0.0318 Tw
(\(for capital letters\),)Tj
/TT4 1 Tf
8.036 0 TD
-0.075 Tc
0 Tw
(Fa)Tj
/TT6 1 Tf
1.3178 0 TD
0 Tc
0.0319 Tw
(\(for small letters\),)Tj
/TT4 1 Tf
-28.7395 -1.1667 TD
0 Tw
(FI)Tj
/TT6 1 Tf
1.2577 0 TD
0.0638 Tw
(\(for capital Roman numerals\), and)Tj
/TT4 1 Tf
14.3142 0 TD
-0.045 Tc
0 Tw
(Fi)Tj
/TT6 1 Tf
1.1574 0 TD
0 Tc
0.0637 Tw
[(\(for small Roman numerals\).)-563.8(From a program-)]TJ
-16.7293 -1.1667 TD
0 Tw
[(mer)55(s)-250(point of vie)25(w)65(,)65( )-65(these may be used to represent formats in tw)10(o)-250(w)10(ays.)]TJ
2.5 -1.5167 TD
[(Using the e)15(xtension, one w)10(ay is to create an)]TJ
/TT4 1 Tf
17.8031 0 TD
[(enumer)15(ated type)]TJ
/TT6 1 Tf
6.8712 0 TD
(by saying)Tj
-22.1744 -1.75 TD
[(enum counter_format { F1, F)74(A, F)15(a, FI, Fi };)]TJ
-5 -1.75 TD
0.3659 Tw
(and declaring the format )Tj
/TT7 1 Tf
11.5149 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.3659 Tw
(eld associated with each counter to be of type)Tj
/TT4 1 Tf
21.7587 0 TD
0 Tw
(enum)Tj
-33.8298 -1.1667 TD
(counter_format)Tj
/TT6 1 Tf
6.2217 0 TD
-0.0001 Tc
0.0155 Tw
[(.)-515.6(But some compilers will not accept this as a le)14.9(gal)-265.5(C)-265.5(statement, so)]TJ
/TT4 1 Tf
27.3849 0 TD
0 Tc
0 Tw
(trnum)Tj
/TT6 1 Tf
-33.6066 -1.1667 TD
0.0337 Tw
[(does not use this C language feature.)-533.8(Instead, it de)]TJ
/TT7 1 Tf
20.6314 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
(nes)Tj
/TT4 1 Tf
1.6168 0 TD
(F1)Tj
/TT6 1 Tf
1.1108 0 TD
(,)Tj
/TT4 1 Tf
0.5338 0 TD
-0.115 Tc
(FA)Tj
/TT6 1 Tf
1.1067 0 TD
0 Tc
(,)Tj
/TT4 1 Tf
0.5337 0 TD
-0.075 Tc
(Fa)Tj
/TT6 1 Tf
1.0358 0 TD
0 Tc
(,)Tj
/TT4 1 Tf
0.5337 0 TD
(FI)Tj
/TT6 1 Tf
0.9438 0 TD
[(,)-283.8(and)]TJ
/TT4 1 Tf
2.2614 0 TD
-0.045 Tc
(Fi)Tj
/TT6 1 Tf
1.1275 0 TD
0 Tc
0.0338 Tw
(as macros)Tj
-31.9917 -1.1667 TD
0.1042 Tw
(and declares the format )Tj
/TT7 1 Tf
10.0234 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.1042 Tw
[(eld to be an inte)15(ger)55(.)-604.3(This w)10(orks with all C compilers, and in)]TJ
-10.5796 -1.1667 TD
0.0801 Tw
(this case the application is simple enough so that the loss of the added type checking is)Tj
T*
0 Tw
[(f)10(a)0(r)-250(outweighed by portability considerations.)]TJ
2.5 -1.5167 TD
0.0532 Tw
[(The three other areas in which the language has been e)15(xtended are closely related.)]TJ
-2.5 -1.1667 TD
0.0901 Tw
(Structure assignment, passing structures as function parameters, and functions returning)Tj
T*
0.0631 Tw
[(structures are no)25(w)-313.1(allo)25(wed. )-250(Depending)-313.1(on the computer)40(,)-313.1(these may or may not increase)]TJ
T*
0.0697 Tw
[(the speed of the program \(some computers can do )74(block mo)15(v)15(es)74()-319.7(which are f)10(aster than)]TJ
T*
0.0725 Tw
[(the corresponding non-block mo)15(v)15(es\). )-250(It)-322.5(is best to a)20(v)20(oid passing structures as ar)18(guments)]TJ
T*
0.0302 Tw
(or writing functions that return structures; instead, pass pointers to structures to and from)Tj
T*
0.0923 Tw
[(functions. )-250.1(As)-342.4(for assignment, it is best to code that as a macro which may be replaced)]TJ
T*
0.1206 Tw
[(with a function call should the program be mo)15(v)15(e)0(d)-370.6(t)0(o)-370.6(a)-370.6(compiler which does not allo)25(w)]TJ
T*
0 Tw
[(structure assignment.)-500(F)15(o)0(r)-250(e)15(xample, the macro)]TJ
5 -1.75 TD
(/)Tj
/TT8 1 Tf
0.2778 0 TD
<009b>Tj
0.0002 -1.1667 TD
<009b>Tj
/TT6 1 Tf
0.75 0 TD
(note a and b are pointers,)Tj
/TT8 1 Tf
-0.75 -1.1667 TD
<009b>Tj
/TT6 1 Tf
0.75 0 TD
[(so if we ha)20(v)15(e)15( )-15(to)-250(con)40(v)15(ert this)]TJ
/TT8 1 Tf
-0.75 -1.1667 TD
<009b>Tj
/TT6 1 Tf
0.75 0 TD
(to a function call, we can)Tj
/TT8 1 Tf
-0.75 -1.1667 TD
<009b>Tj
/TT6 1 Tf
0.75 0 TD
(just pass the pointers)Tj
/TT8 1 Tf
-0.75 -1.1667 TD
<009b>Tj
/TT6 1 Tf
0.5 0 TD
(/)Tj
-0.778 -1.1667 TD
(#de)Tj
/TT7 1 Tf
1.4438 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
[(ne STR)40(UCTURE_COPY\(a,b\) )-1735(\(*\(a\))-250(=)-250(*\(b\)\))]TJ
-7 -1.75 TD
[(w)10(orks quite nicely)65(.)]TJ
2.5 -1.5167 TD
0.0721 Tw
[(The other area in which compilers are v)15(ery dif)25(ferent is the order in which e)15(xpres-)]TJ
-2.5 -1.1667 TD
0.067 Tw
[(sions are e)25(v)25(aluated; the best kno)25(wn result of this is that functions producing side ef)25(fects)]TJ
T*
0 Tw
(should)Tj
/TT4 1 Tf
2.9871 0 TD
[(ne)15(ver)]TJ
/TT6 1 Tf
2.5258 0 TD
0.0701 Tw
[(be used in e)15(xpressions in)40(v)20(olving an)15(y)-320.1(v)25(ariables or functions af)25(fected by the)]TJ
-5.5129 -1.1667 TD
0.0454 Tw
[(side ef)25(fects. )-250(The)-295.4(order in which e)15(xpressions are e)25(v)25(aluated is left unde)]TJ
/TT7 1 Tf
28.4828 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0455 Tw
(ned by the C ref-)Tj
-29.0389 -1.1667 TD
0.0319 Tw
[(erence manual v)15(ery deliberately)65(,)-281.9(t)0(o)-281.9(allo)25(w)-281.9(the compiler writer to choose the most ef)]TJ
/TT7 1 Tf
33.4946 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
(cient)Tj
-34.0507 -1.1667 TD
0.017 Tw
[(method for the tar)18(get machine.)-517.1(W)80(e)80( )-80.1(shall look at tw)10(o)-267.1(cases where this af)25(fects e)15(xpressions,)]TJ
T*
0 Tw
[(and ho)25(w)-250(t)0(o)-250(w)10(ork around this ambiguity)65(.)]TJ
2.5 -1.5167 TD
(The )Tj
/TT7 1 Tf
1.8116 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0068 Tw
[(rst e)15(xample is the order in which function ar)18(guments are e)25(v)25(aluated. )-250(In)]TJ
/TT4 1 Tf
28.4893 0 TD
0 Tw
(trnum)Tj
/TT6 1 Tf
2.3892 0 TD
(,)Tj
-35.7462 -1.1667 TD
0.0405 Tw
(there is a function called)Tj
/TT4 1 Tf
10.2817 0 TD
0 Tw
[(g)10(etne)20(xt)]TJ
/TT6 1 Tf
2.8572 0 TD
0.0406 Tw
(\(\) which is most often called with the )Tj
/TT7 1 Tf
15.4878 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0406 Tw
(rst character of a)Tj
-29.1828 -1.1667 TD
0.022 Tw
(string as its )Tj
/TT7 1 Tf
4.8717 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.022 Tw
[(rst ar)18(gument, and a pointer to the remainder of the string as its second ar)18(gu-)]TJ
-5.4278 -1.1667 TD
0.2632 Tw
[(ment. Hence,)-263.2(if)]TJ
/TT4 1 Tf
6.7036 0 TD
0 Tw
(p)Tj
/TT6 1 Tf
0.7632 0 TD
0.0132 Tw
[(is the pointer to the be)15(ginning of the string, it is most tempting to write)]TJ
-7.4667 -1.1667 TD
0 Tw
(this call as:)Tj
ET
endstream
endobj
12 0 obj
<<
/ProcSet [ /PDF /Text ]
/Font << /TT4 5 0 R /TT6 6 0 R /TT7 7 0 R /TT8 13 0 R >>
/ExtGState << /GS1 8 0 R >>
>>
endobj
13 0 obj
<<
/Type /Font
/Subtype /Type0
/BaseFont /OIHKEG+Symbol
/Encoding /Identity-H
/DescendantFonts [ 53 0 R ]
/ToUnicode 54 0 R
>>
endobj
14 0 obj
<<
/Type /Page
/Parent 9 0 R
/Resources 16 0 R
/Contents 15 0 R
>>
endobj
15 0 obj
<< /Length 4449 >>
stream
BT
/TT6 1 Tf
12 0 0 12 72 791.89 Tm
0 g
/GS1 gs
0 Tc
0 Tw
[(The C Journal)-12084(3)-333( )-14111(8/5/104)]TJ
ET
BT
12 0 0 12 132 755.8901 Tm
[(getne)15(xt\()]TJ
/TT8 1 Tf
3.2614 0 TD
<009b>Tj
/TT6 1 Tf
0.5 0 TD
(p++, p\);)Tj
-8.7614 -1.75 TD
0.1118 Tw
[(No)25(w)65(,)65( suppose)]TJ
/TT4 1 Tf
5.9202 0 TD
0 Tw
(p)Tj
/TT6 1 Tf
0.7968 0 TD
0.0467 Tw
[(points to the string )74(.y>)74(. )-250.1(If)-296.8(the compiler e)25(v)25(aluates function ar)18(guments)]TJ
-6.717 -1.1667 TD
0 Tw
[(be)15(ginning at the left,)]TJ
/TT4 1 Tf
8.5104 0 TD
[(g)10(etne)20(xt)]TJ
/TT6 1 Tf
2.8572 0 TD
(\(\) will be called as)Tj
-6.3676 -1.75 TD
[(getne)15(xt\(.)70(, )74(y>)74(\);)]TJ
-5 -1.75 TD
0.0605 Tw
[(as we w)10(ant. )-250.1(But,)-310.6(if the compiler e)25(v)25(aluates function ar)18(guments be)15(ginning at the right \(as)]TJ
0 -1.1667 TD
0 Tw
[(do V)135(AX and PDP-11 compilers\), the call becomes)]TJ
5 -1.75 TD
[(getne)15(xt\(.)70(, )74(.y>)74(\);)]TJ
-5 -1.75 TD
0.0676 Tw
[(which is not what we e)15(xpected. )-250.1(The)-317.7(only w)10(ay to guarantee the order of e)25(v)25(aluation is to)]TJ
0 -1.1667 TD
0 Tw
[(use a temporary v)25(ariable:)]TJ
5 -1.75 TD
(base = &p[1];)Tj
0 -1.1667 TD
[(getne)15(xt\()]TJ
/TT8 1 Tf
3.2614 0 TD
<009b>Tj
/TT6 1 Tf
0.5 0 TD
(p++, base\);)Tj
-8.7614 -1.75 TD
[(This will w)10(ork on all compilers.)]TJ
2.5 -1.5167 TD
0.0867 Tw
[(As a second e)15(xample of the dangers of assuming an order of e)25(v)25(aluation, consider)]TJ
-2.5 -1.1667 TD
0 Tw
[(the e)15(xpression)]TJ
5 -1.75 TD
(a[i] = b[i--];)Tj
-5 -1.75 TD
0.1373 Tw
(which might be used as part of a)Tj
/TT4 1 Tf
14.3174 0 TD
0 Tw
(while)Tj
/TT6 1 Tf
2.5538 0 TD
0.1372 Tw
[(loop for cop)10(ying strings \(there are man)15(y)-387.2(such)]TJ
-16.8713 -1.1667 TD
0.0153 Tw
(loops in)Tj
/TT4 1 Tf
3.4753 0 TD
0 Tw
(trnum)Tj
/TT6 1 Tf
2.3892 0 TD
0.2652 Tw
(\). If)Tj
/TT4 1 Tf
2.0295 0 TD
0 Tw
(i)Tj
/TT6 1 Tf
0.5431 0 TD
0.0153 Tw
(is 1,)Tj
/TT4 1 Tf
1.9475 0 TD
0 Tw
(b[0])Tj
/TT6 1 Tf
2.0436 0 TD
0.0153 Tw
(is x, and)Tj
/TT4 1 Tf
4.3229 0 TD
0 Tw
(b[1])Tj
/TT6 1 Tf
2.0437 0 TD
0.0153 Tw
(is y, then this statement will assign y to)Tj
/TT4 1 Tf
-18.7947 -1.1667 TD
0 Tw
(a[1])Tj
/TT6 1 Tf
2.118 0 TD
0.0897 Tw
[(if the e)15(xpression is e)25(v)25(aluated from left to tight, b)20(ut it will assign y to)]TJ
/TT4 1 Tf
29.5881 0 TD
0 Tw
(a[0])Tj
/TT6 1 Tf
2.118 0 TD
0.0897 Tw
(if the)Tj
-33.8241 -1.1667 TD
-0.0001 Tc
0.1027 Tw
[(e)14.9(xpression is e)24.9(v)24.9(aluated from right to left.)-602.8(Again, to get around this problem, m)]TJ
33.0073 0 TD
-0.015 Tc
0.1327 Tw
[(ove t)-15(h)-15(e)]TJ
-33.0073 -1.1667 TD
0 Tc
0 Tw
(decrement of)Tj
/TT4 1 Tf
5.4971 0 TD
(i)Tj
/TT6 1 Tf
0.5278 0 TD
(outside the assignment statement, and say)Tj
-1.0249 -1.75 TD
(a[i] = b[i];)Tj
0 -1.1667 TD
(i--;)Tj
-5 -1.75 TD
(if the )Tj
/TT7 1 Tf
2.3325 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
[(rst interpretation is what you w)10(ant, or)]TJ
2.1113 -1.75 TD
(i--;)Tj
0 -1.1667 TD
(a[i] = b[i];)Tj
-5 -1.75 TD
[(if the second interpretation is what you w)10(ant.)]TJ
/TT2 1 Tf
11.1115 -3.5 TD
(Operating System Dependencies)Tj
/TT6 1 Tf
-8.6115 -2.6833 TD
0.0118 Tw
[(Unlik)10(e)-261.9(changing C compilers, it is not possible to write C code that will not change)]TJ
-2.5 -1.1667 TD
0.2322 Tw
[(at some le)25(v)15(e)0(l)-482.2(when mo)15(v)15(e)0(d)-482.2(t)0(o)-482.2(another operating system.)-732.2(The trick is to k)10(eep those)]TJ
T*
0.1178 Tw
(changes con)Tj
/TT7 1 Tf
5.0324 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.1178 Tw
(ned to library functions, header )Tj
/TT7 1 Tf
13.3626 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.1177 Tw
[(les, or both.)-617.8(W)40(ith properly-written pro-)]TJ
-19.5073 -1.1667 TD
0.0699 Tw
(grams, it should only be necessary to change the library functions or header )Tj
/TT7 1 Tf
31.3996 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0699 Tw
(les appro-)Tj
-31.9558 -1.1667 TD
0.1262 Tw
[(priately)65(,)-376.2(and recompile and relink the program.)-626.3(In most cases, only recompilation and)]TJ
T*
0.0369 Tw
[(relinking will be necessary)65(,)-286.9(since the majority of applications programs access the k)10(ernel)]TJ
T*
0.1842 Tw
[(using libraries pro)15(vided with the operating system \(such as the)]TJ
/TT4 1 Tf
27.0993 0 TD
0 Tw
[(standar)37(d)-434.2(input-output)]TJ
-27.0993 -1.1667 TD
[(libr)15(ary)]TJ
/TT6 1 Tf
2.7628 0 TD
[(,)-250(also called)]TJ
/TT4 1 Tf
4.998 0 TD
(stdio)Tj
/TT6 1 Tf
1.9448 0 TD
(.\))Tj
ET
endstream
endobj
16 0 obj
<<
/ProcSet [ /PDF /Text ]
/Font << /TT2 4 0 R /TT4 5 0 R /TT6 6 0 R /TT7 7 0 R /TT8 13 0 R >>
/ExtGState << /GS1 8 0 R >>
>>
endobj
17 0 obj
<<
/Type /Page
/Parent 9 0 R
/Resources 19 0 R
/Contents 18 0 R
>>
endobj
18 0 obj
<< /Length 7575 >>
stream
BT
/TT6 1 Tf
12 0 0 12 72 791.89 Tm
0 g
/GS1 gs
0 Tc
0 Tw
[(The C Journal)-12084(4)-333( )-14111(8/5/104)]TJ
ET
BT
12 0 0 12 102 755.8901 Tm
0.0203 Tw
(The program)Tj
/TT4 1 Tf
5.4829 0 TD
0 Tw
(trnum)Tj
/TT6 1 Tf
2.6594 0 TD
0.0203 Tw
[(f)10(alls into this class of programs because its interaction with the)]TJ
-10.6423 -1.1667 TD
0.0882 Tw
[(operating system is done through the standard input-output library package.)-588.3(So long as)]TJ
T*
0.0901 Tw
[(this \(relati)25(v)15(ely\) standard interf)10(ace e)15(xists, it can be compiled and link)10(ed without change,)]TJ
T*
0.0169 Tw
[(and the package will handle the details of interf)10(acing the program)55(s)-266.9(input and output with)]TJ
T*
0.0428 Tw
[(the operating system.)-542.8(Let us look at ho)25(w)-292.8(this package hides operating system dependent)]TJ
T*
0 Tw
(details from)Tj
/TT4 1 Tf
5.0542 0 TD
(trnum)Tj
/TT6 1 Tf
2.3892 0 TD
(.)Tj
-4.9434 -1.5167 TD
(The)Tj
/TT4 1 Tf
1.8264 0 TD
(stdio)Tj
/TT6 1 Tf
2.2165 0 TD
0.0216 Tw
(package associates with each )Tj
/TT7 1 Tf
11.9696 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0216 Tw
[(le a collection of information such as ho)25(w)]TJ
-19.0686 -1.1667 TD
0 Tw
(the )Tj
/TT7 1 Tf
1.6473 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
0.1756 Tw
[(le w)10(as opened \(for reading, writing, or appending\), the current of)25(fset of the )]TJ
/TT7 1 Tf
32.5157 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
(le)Tj
-35.2752 -1.1667 TD
0.1382 Tw
(pointer into the )Tj
/TT7 1 Tf
6.7744 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.1382 Tw
(le, and the )Tj
/TT7 1 Tf
4.8017 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.1381 Tw
[(le inde)15(x)-388.2(number)55(.)-638.2(This structure is hidden by de)]TJ
/TT7 1 Tf
20.1419 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.1381 Tw
(ning a)Tj
-33.3864 -1.1667 TD
0 Tw
[(structure and macro similar to the follo)25(wing in the header )]TJ
/TT7 1 Tf
23.2455 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
(le <)Tj
/TT4 1 Tf
1.5356 0 TD
(stdio.h)Tj
/TT6 1 Tf
2.6948 0 TD
(>:)Tj
-23.0321 -1.75 TD
(struct _)Tj
/TT7 1 Tf
2.9717 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
(nfo {)Tj
-1.5278 -1.1667 TD
(int _)Tj
/TT7 1 Tf
1.8057 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
2.181 Tw
[(leinde)15(x; /)]TJ
/TT8 1 Tf
5.915 0 TD
0 Tw
<009b>Tj
/TT6 1 Tf
0.75 0 TD
[(inde)15(x)-250(into )]TJ
/TT7 1 Tf
4.2623 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
(le table)Tj
/TT8 1 Tf
3.165 0 TD
<009b>Tj
/TT6 1 Tf
0.5 0 TD
(/)Tj
-17.5104 -1.1667 TD
[(unsigned int _mode;)-1833(/)]TJ
/TT8 1 Tf
10.2768 0 TD
<009b>Tj
/TT6 1 Tf
0.75 0 TD
(open for read, write)Tj
/TT8 1 Tf
8.1353 0 TD
<009b>Tj
/TT6 1 Tf
0.5 0 TD
(/)Tj
-21.6621 -1.1667 TD
(};)Tj
T*
(#de)Tj
/TT7 1 Tf
1.4438 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
0.806 Tw
[(ne FILE)-1889(struct )806(_)]TJ
/TT7 1 Tf
8.9714 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
(nfo)Tj
-16.5275 -1.75 TD
[(and no)25(w)-250(for each dif)25(ferent operating system, the header )]TJ
/TT7 1 Tf
22.4964 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
(le can be changed as required.)Tj
-20.5525 -1.5167 TD
0.1496 Tw
[(As another e)15(xample, each operating system has its o)25(wn system call for opening)]TJ
/TT7 1 Tf
-2.5 -1.1667 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0287 Tw
[(les. )-250(These)-278.7(may)65(,)-278.7(o)0(r)-278.7(may not, be compatible with the system calls of other operating sys-)]TJ
-0.5562 -1.1667 TD
0.1135 Tw
[(tems; for e)15(xample, on V7 UNIX, the second ar)18(gument to the)]TJ
/TT4 1 Tf
25.6813 0 TD
0 Tw
(open)Tj
/TT6 1 Tf
2.3074 0 TD
0.1135 Tw
(system call is)Tj
/TT2 1 Tf
5.9787 0 TD
0 Tw
(2)Tj
/TT6 1 Tf
0.8635 0 TD
(for)Tj
-34.8309 -1.1667 TD
0.0155 Tw
(appending to the )Tj
/TT7 1 Tf
6.9615 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0154 Tw
[(le, b)20(ut on 4.2 BSD UNIX, the second ar)18(gument must be)]TJ
/TT2 1 Tf
22.7402 0 TD
0 Tw
(8)Tj
/TT6 1 Tf
0.7654 0 TD
0.0154 Tw
(to append to)Tj
-31.0233 -1.1667 TD
0 Tw
(the )Tj
/TT7 1 Tf
1.5913 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
[(le.)-619.6(F)15(ortunately)65(,)-369.6(the)]TJ
/TT4 1 Tf
8.3325 0 TD
(stdio)Tj
/TT6 1 Tf
2.3144 0 TD
0.1196 Tw
[(package pro)15(vides a uniform interf)10(ace for opening a )]TJ
/TT7 1 Tf
21.6454 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
(le;)Tj
-34.9958 -1.1667 TD
(saying)Tj
5 -1.75 TD
(fp = fopen\()Tj
/TT9 1 Tf
4.5068 0 TD
()Tj
/TT4 1 Tf
0.5 0 TD
(lename)Tj
/TT6 1 Tf
2.8877 0 TD
[(,)-250("a"\);)]TJ
-12.8945 -1.75 TD
0.19 Tw
(will open the named )Tj
/TT7 1 Tf
9.1467 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
-0.0001 Tc
0.1901 Tw
[(le for appending, re)14.9(gardless of what the operating system call)]TJ
-9.7029 -1.1667 TD
0.0573 Tw
[(requires. )-250(Again, the details of interacting with the operating system are se)14.9(gre)14.9(gated from)]TJ
T*
0 Tc
0 Tw
(the rest of the program.)Tj
2.5 -1.5167 TD
0.0076 Tw
[(A)-257.7(f)10(ar less common, b)20(ut more dramatic, e)15(xample of this occurs when a program that)]TJ
-2.5 -1.1667 TD
0.1374 Tw
(reads the contents of directory )Tj
/TT7 1 Tf
13.0435 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.1374 Tw
[(les is ported from V7 UNIX to 4.2 BSD UNIX.)-637.4(The)]TJ
-13.5997 -1.1667 TD
0.0918 Tw
[(directory formats are v)25(astly dif)25(ferent; for instance, V7 UNIX uses a )]TJ
/TT7 1 Tf
28.2839 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0918 Tw
[(x)15(ed-length record)]TJ
-28.84 -1.1667 TD
0.0461 Tw
(for each )Tj
/TT7 1 Tf
3.5897 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0461 Tw
[(le name in the directory)65(,)-296.1(whereas 4.2 BSD UNIX uses v)25(ariable-length records.)]TJ
-4.1459 -1.1667 TD
0.0224 Tw
(Hence, the directory should be accessed only through a set of functions separate from the)Tj
T*
0.0297 Tw
[(rest of the program.)-529.7(So, for e)15(xample, use routines called)]TJ
/TT4 1 Tf
23.2197 0 TD
0 Tw
[(open_dir)37(ectory)]TJ
/TT6 1 Tf
6.0724 0 TD
(,)Tj
/TT4 1 Tf
0.5298 0 TD
[(r)37(ead_dir)37(ectory)]TJ
/TT6 1 Tf
5.9245 0 TD
(,)Tj
-35.7464 -1.1667 TD
(and)Tj
/TT4 1 Tf
1.7334 0 TD
[(close_dir)37(ectory)]TJ
/TT6 1 Tf
6.4728 0 TD
0.0395 Tw
(to open, look through, and close the directory )Tj
/TT7 1 Tf
18.7559 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0395 Tw
(le rather than putting)Tj
-27.5183 -1.1667 TD
0.0621 Tw
[(the directory scanning code with the rest of the program code.)-562.1(Then, when the program)]TJ
T*
0.0751 Tw
[(is mo)15(v)15(e)0(d)-325.1(from a V7 UNIX system to a 4.2 BSD UNIX system, only the three directory)]TJ
T*
0 Tw
[(accessing routines need be re)25(written.)]TJ
2.5 -1.5167 TD
0.1179 Tw
[(Another problem arises when you use library functions that the system pro)15(vides.)]TJ
-2.5 -1.1667 TD
0.0853 Tw
[(Sometimes these dif)25(fer from system to system.)-585.3(The least dangerous of this is when the)]TJ
T*
0.1164 Tw
(function returns one datatype for an operating system and another datatype for another)Tj
T*
0.1295 Tw
[(operating system.)-629.5(In)]TJ
/TT4 1 Tf
9.0257 0 TD
0 Tw
(trnum)Tj
/TT6 1 Tf
2.3892 0 TD
0.1295 Tw
[(,)-379.5(the function)]TJ
/TT4 1 Tf
5.9427 0 TD
0 Tw
(sprintf)Tj
/TT6 1 Tf
2.9913 0 TD
0.1294 Tw
[(did this \(returning an inte)15(ger in SYS-)]TJ
-20.3489 -1.1667 TD
0.0871 Tw
[(TEM V UNIX and a character pointer in 4.2 BSD UNIX.\))-587.1(There is no ob)15(vious w)10(ay to)]TJ
T*
0.1058 Tw
[(determine what these functions are other than going to a manual, b)20(ut you should a)20(v)20(oid)]TJ
T*
0.002 Tw
[(relying on return v)25(alues of functions for which return v)25(alues are not central to the purpose)]TJ
T*
0.0214 Tw
[(of the function.)-521.4(In)]TJ
/TT4 1 Tf
7.8059 0 TD
0 Tw
(trnum)Tj
/TT6 1 Tf
2.3892 0 TD
0.0213 Tw
[(,)-271.3(for e)15(xample,)]TJ
/TT4 1 Tf
5.8522 0 TD
0 Tw
(sprintf)Tj
/TT6 1 Tf
2.8832 0 TD
0.0213 Tw
[(w)10(a)0(s)-271.3(used to format a string in core, and so)]TJ
ET
endstream
endobj
19 0 obj
<<
/ProcSet [ /PDF /Text ]
/Font << /TT2 4 0 R /TT4 5 0 R /TT6 6 0 R /TT7 7 0 R /TT8 13 0 R /TT9 20 0 R >>
/ExtGState << /GS1 8 0 R >>
>>
endobj
20 0 obj
<<
/Type /Font
/Subtype /TrueType
/FirstChar 222
/LastChar 222
/Widths [ 500 ]
/Encoding /MacRomanEncoding
/BaseFont /Times-Italic
/FontDescriptor 48 0 R
>>
endobj
21 0 obj
<<
/Type /Page
/Parent 9 0 R
/Resources 23 0 R
/Contents 22 0 R
>>
endobj
22 0 obj
<< /Length 7058 >>
stream
BT
/TT6 1 Tf
12 0 0 12 72 791.89 Tm
0 g
/GS1 gs
0 Tc
0 Tw
[(The C Journal)-12084(5)-333( )-14111(8/5/104)]TJ
ET
BT
12 0 0 12 72 755.8901 Tm
0.207 Tw
[(the return v)25(alue w)10(as completely ignored; hence, when it w)10(as mo)15(v)15(e)0(d)-457(t)0(o)-457(SYSTEM V)]TJ
0 -1.1667 TD
0 Tw
[(UNIX, there w)10(as ne)25(v)15(e)0(r)-250(a)-250(problem.)]TJ
2.5 -1.5167 TD
0.1072 Tw
[(Some library functions ha)20(v)15(e)15( )-15(no)-357.2(counterparts on other systems.)-607.2(Examples are the)]TJ
/TT4 1 Tf
-2.5 -1.1667 TD
0 Tw
[(sear)37(c)15(h)]TJ
/TT6 1 Tf
2.9258 0 TD
0.0617 Tw
[(functions pro)15(vided by SYSTEM V UNIX.)-561.8(In this case, all that can be done is to)]TJ
-2.9258 -1.1667 TD
0.0695 Tw
[(write equi)25(v)25(alent functions.)-569.5(A)-319.5(similar b)20(ut more subtle form of this occurs when tw)10(o)-319.5(dif-)]TJ
T*
0.0932 Tw
[(ferent functions ha)20(v)15(e)15( )-15(the same name on dif)25(ferent systems.)-593.3(F)15(ortunately)65(,)-343.3(neither of these)]TJ
T*
0.0575 Tw
(occurred in)Tj
/TT4 1 Tf
4.8904 0 TD
0 Tw
(trnum)Tj
/TT6 1 Tf
2.3892 0 TD
0.0575 Tw
[(;)-307.5(the only thing that can be done about them is to check the manual of)]TJ
-7.2796 -1.1667 TD
0 Tw
(the operating system the program is being ported to.)Tj
2.5 -1.5167 TD
0.1377 Tw
[(Aside from localizing operating system dependencies in functions, there are tw)10(o)]TJ
-2.5 -1.1667 TD
0.1668 Tw
[(other considerations programmers must k)10(eep in mind -- de)]TJ
/TT7 1 Tf
24.7631 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.1668 Tw
[(ning and naming e)15(xternal)]TJ
-25.3193 -1.1667 TD
0 Tw
[(v)25(ariables. )-250(W)80(e)-250(will look at naming them )]TJ
/TT7 1 Tf
16.1963 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
(rst.)Tj
-14.2524 -1.5167 TD
0.0532 Tw
[(As stated in the pre)25(vious section, most compilers impose a maximum on the num-)]TJ
-2.5 -1.1667 TD
0.082 Tw
(ber of signi)Tj
/TT7 1 Tf
4.7187 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.082 Tw
(cant characters in identi)Tj
/TT7 1 Tf
9.7689 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.082 Tw
[(ers.)-582(Ho)25(we)25(v)15(e)0(r)40(,)40( )-40(the link)10(er also uses these names to)]TJ
-15.5999 -1.1667 TD
0.0811 Tw
[(link the program modules together)55(.)-581.1(O)0(n)-331.1(some systems, the maximum number of signi)]TJ
/TT7 1 Tf
35.1075 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
(-)Tj
-35.6636 -1.1667 TD
0.0782 Tw
(cant characters of identi)Tj
/TT7 1 Tf
9.8126 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0782 Tw
[(ers the link)10(er recognizes is dif)25(ferent than the number the com-)]TJ
-10.3688 -1.1667 TD
0.1052 Tw
[(piler recognizes.)-605.2(Furthermore, some link)10(ers ignore the case of characters in identi)]TJ
/TT7 1 Tf
34.0233 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
(ers.)Tj
-34.5795 -1.1667 TD
0.0549 Tw
[(Hence, all e)15(xternal symbols should be unique within the )]TJ
/TT7 1 Tf
23.1967 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0549 Tw
[(rst six characters, e)15(xclusi)25(v)15(e)15( )-15(of)]TJ
-23.7529 -1.1667 TD
0.0372 Tw
[(case. )-250(\(This)-287.2(seems to be the least common denominator of the restrictions.\))-537.2(As an e)15(xam-)]TJ
T*
0.0499 Tw
(ple, the)Tj
/TT4 1 Tf
3.2932 0 TD
0 Tw
(trnum)Tj
/TT6 1 Tf
2.6891 0 TD
0.0498 Tw
(program uses the function)Tj
/TT4 1 Tf
10.8634 0 TD
0 Tw
(issalnum)Tj
/TT6 1 Tf
3.5562 0 TD
0.0498 Tw
(\(\) to determine if a string is composed)Tj
-20.4018 -1.1667 TD
0.0222 Tw
(of alphanumeric characters; the name)Tj
/TT4 1 Tf
15.353 0 TD
0 Tw
(isalnum_str)Tj
/TT6 1 Tf
4.7231 0 TD
0.0222 Tw
[(\(\) \(for )74(is alphanumeric string)74(\) w)10(ould)]TJ
-20.0762 -1.1667 TD
0.0813 Tw
[(be more readable, b)20(ut has the same )]TJ
/TT7 1 Tf
14.8216 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0813 Tw
(rst six characters as the function)Tj
/TT4 1 Tf
13.5944 0 TD
0 Tw
(isalnum)Tj
/TT6 1 Tf
3.167 0 TD
0.0813 Tw
(\(\); hence,)Tj
-32.1391 -1.1667 TD
0 Tw
(this could produce a con)Tj
/TT7 1 Tf
9.7749 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
(ict.)Tj
-7.8311 -1.5167 TD
0.0455 Tw
[(The other problem with e)15(xternal v)25(ariables arises when the k)10(e)15(yw)10(ord)]TJ
/TT4 1 Tf
27.5929 0 TD
0 Tw
[(e)20(xtern)]TJ
/TT6 1 Tf
2.774 0 TD
0.0455 Tw
(is omit-)Tj
-32.8669 -1.1667 TD
0.1077 Tw
[(ted in a declaration.)-607.8(W)40(ith man)15(y)-357.7(v)15(ersions of the UNIX operating system, if an e)15(xternal)]TJ
T*
0.0497 Tw
[(v)25(ariable is de)]TJ
/TT7 1 Tf
5.4054 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0497 Tw
[(ned in se)25(v)15(eral )]TJ
/TT7 1 Tf
5.9122 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0497 Tw
[(les, the link)10(er just uses one de)]TJ
/TT7 1 Tf
12.2577 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0497 Tw
(nition and ignores the oth-)Tj
-25.2438 -1.1667 TD
0.0613 Tw
[(ers. )-250.1(Man)15(y)-311.4(other UNIX systems will object that the v)25(ariable is multiply de)]TJ
/TT7 1 Tf
30.3568 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0613 Tw
[(ned, and f)10(ail)]TJ
-30.913 -1.1667 TD
0.0372 Tw
[(to link the modules.)-537.2(Thus, in)]TJ
/TT4 1 Tf
12.1947 0 TD
0 Tw
(trnum)Tj
/TT6 1 Tf
2.3892 0 TD
0.0372 Tw
[(,)-287.2(all v)25(ariables that are referenced by routines in more)]TJ
-14.5838 -1.1667 TD
0.0652 Tw
(than one )Tj
/TT7 1 Tf
3.7959 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0652 Tw
(le were de)Tj
/TT7 1 Tf
4.2387 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0652 Tw
(ned in the )Tj
/TT7 1 Tf
4.3889 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0652 Tw
(le containing the main routine and simply declared as)Tj
/TT4 1 Tf
-14.0919 -1.1667 TD
0 Tw
[(e)20(xtern)]TJ
/TT6 1 Tf
2.7871 0 TD
0.0586 Tw
[(in all the others.)-558.7(F)15(o)0(r)-308.7(e)15(xample, the v)25(ariable)]TJ
/TT4 1 Tf
17.8252 0 TD
0 Tw
(topt)Tj
/TT6 1 Tf
1.5557 0 TD
0.0587 Tw
[(,)-308.7(which is 1 when a table of num-)]TJ
-22.168 -1.1667 TD
0 Tw
(bers is to be generated and 0 when it is not, is declared as)Tj
5 -1.75 TD
[(int topt;)-2860(/)]TJ
/TT8 1 Tf
6.277 0 TD
<009b>Tj
/TT6 1 Tf
0.75 0 TD
(generate table of numbers?)Tj
/TT8 1 Tf
11.0503 0 TD
<009b>Tj
/TT6 1 Tf
0.5 0 TD
(/)Tj
-23.5773 -1.75 TD
(in the main )Tj
/TT7 1 Tf
4.749 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
(le and as)Tj
-0.3052 -1.75 TD
[(e)15(xtern int topt;)-126(/)]TJ
/TT8 1 Tf
6.2765 0 TD
<009b>Tj
/TT6 1 Tf
0.75 0 TD
(generate table of numbers?)Tj
/TT8 1 Tf
11.0503 0 TD
<009b>Tj
/TT6 1 Tf
0.5 0 TD
(/)Tj
-23.5768 -1.75 TD
(in the other )Tj
/TT7 1 Tf
4.8042 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
[(les.)-500(This pre)25(v)15(ents the link)10(er from )]TJ
/TT7 1 Tf
13.7244 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
(nding multiply de)Tj
/TT7 1 Tf
7.1108 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
[(ned v)25(ariables.)]TJ
/TT2 1 Tf
-14.2104 -3.5 TD
(Machine Dependencies)Tj
/TT6 1 Tf
-10.5975 -2.6833 TD
0.2111 Tw
[(Se)25(v)15(eral f)10(actors combine to create problems when mo)15(ving a program from one)]TJ
-2.5 -1.1667 TD
0.1231 Tw
[(machine to another)55(.)-623.1(All of these spring from dif)25(ferences in the computer architectures)]TJ
T*
0.2242 Tw
[(and the C compiler)55(s)-474.3(customizing object code to be as ef)]TJ
/TT7 1 Tf
24.8225 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.2243 Tw
(cient as possible for that)Tj
-25.3787 -1.1667 TD
0 Tw
(machine.)Tj
ET
endstream
endobj
23 0 obj
<<
/ProcSet [ /PDF /Text ]
/Font << /TT2 4 0 R /TT4 5 0 R /TT6 6 0 R /TT7 7 0 R /TT8 13 0 R >>
/ExtGState << /GS1 8 0 R >>
>>
endobj
24 0 obj
<<
/Type /Page
/Parent 9 0 R
/Resources 26 0 R
/Contents 25 0 R
>>
endobj
25 0 obj
<< /Length 4870 >>
stream
BT
/TT6 1 Tf
12 0 0 12 72 791.89 Tm
0 g
/GS1 gs
0 Tc
0 Tw
[(The C Journal)-12084(6)-333( )-14111(8/5/104)]TJ
ET
BT
12 0 0 12 102 755.8901 Tm
0.0547 Tw
[(As an e)15(xample, consider the representation of v)25(arious datatypes.)-554.7(Assuming a spe-)]TJ
-2.5 -1.1667 TD
0 Tw
(ci)Tj
/TT7 1 Tf
0.7217 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
0.089 Tw
[(c number of bits for characters, short inte)15(gers, inte)15(gers, and long inte)15(gers is a recipe)]TJ
-1.2778 -1.1667 TD
0.0919 Tw
[(for disaster)40(,)-341.9(because this number may not be the same for all machines.)-592(Unfortunately)65(,)]TJ
T*
0.0212 Tw
[(this type of assumption is v)15(ery common, particularly when using bits as )]TJ
/TT7 1 Tf
29.2077 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
[(ags.)-521.2(F)15(o)0(r)-271.2(e)15(xam-)]TJ
-29.7638 -1.1667 TD
0.1017 Tw
(ple, in)Tj
/TT4 1 Tf
2.9528 0 TD
0 Tw
(trnum)Tj
/TT6 1 Tf
2.3892 0 TD
0.1017 Tw
[(,)-351.7(the structure of the hash table used to store counters contains a w)10(ord for)]TJ
-5.342 -1.1667 TD
0 Tw
(miscellaneous )Tj
/TT7 1 Tf
5.9469 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0317 Tw
[(ags; if the lo)25(w)-281.8(bit is set, that entry is unused.)-531.8(It is v)15(ery tempting to write)]TJ
-6.503 -1.1667 TD
0 Tw
[(the statement clearing the lo)25(w)-250(bit as)]TJ
/TT7 1 Tf
5 -1.75 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
(ag &= 0177776;)Tj
-5.5562 -1.75 TD
0.0546 Tw
[(on a PDP-11 \(which has 16 bit w)10(ords\), b)20(ut this will f)10(ail miserably on a V)135(AX, which has)]TJ
0 -1.1667 TD
0 Tw
[(32 bit w)10(ords \(and hence will clear the high-order 16 bits as well.\))-500(Ho)25(we)25(v)15(e)0(r)40(,)40( )-40(writing)]TJ
/TT7 1 Tf
5 -1.75 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
(ag &= 01;)Tj
-5.5562 -1.75 TD
0.0472 Tw
[(will clear the bit on an)15(y)-297.3(machine, because the compiler will automatically change )74(01)74()]TJ
0 -1.1667 TD
0.0561 Tw
[(into a w)10(ord with the lo)25(w)-306.1(bit clear and all other bits set.)-556.1(The moral is to let the compiler)]TJ
T*
0 Tw
[(w)10(orry about datatype lengths.)]TJ
2.5 -1.5167 TD
0.1503 Tw
[(Another obnoxious problem arises when you assume tw)10(o)-400.3(datatypes can be used)]TJ
-2.5 -1.1667 TD
0.0585 Tw
[(interchangeably)65(.)-558.5(Recall the function)]TJ
/TT4 1 Tf
15.1632 0 TD
0 Tw
(issalnum)Tj
/TT6 1 Tf
3.5562 0 TD
0.0586 Tw
[(\(\); it tak)10(es a pointer to a string as its ar)18(gu-)]TJ
-18.7194 -1.1667 TD
0.25 Tw
[(ment. Call)-250(this )250(parameter)]TJ
/TT4 1 Tf
10.6079 0 TD
0 Tw
(s)Tj
/TT6 1 Tf
0.3892 0 TD
[(.)-500(Man)15(y)-250(programmers w)10(ould tend to declare this function as)]TJ
-5.9971 -1.75 TD
(int issalnum\(s\))Tj
0 -1.1667 TD
({)Tj
2 -1.1667 TD
(...)Tj
-7 -1.75 TD
0.0906 Tw
[(and on man)15(y)-340.6(machines there w)10(ould be no problem, since a pointer to a character is the)]TJ
0 -1.1667 TD
0.0752 Tw
[(same length as an inte)15(ger)55(.)-575.3(But on some machines, this w)10(ould f)10(ail \(with a core dump, if)]TJ
T*
0.0689 Tw
[(you are luck)15(y\) because the tw)10(o)-318.9(are not interchangeable.)-568.9(The declaration should be \(and)]TJ
T*
0 Tw
(in)Tj
/TT4 1 Tf
1.0278 0 TD
(trnum)Tj
/TT6 1 Tf
2.6392 0 TD
(is\) written:)Tj
1.333 -1.75 TD
(int issalnum\(s\))Tj
0 -1.1667 TD
(char)Tj
/TT8 1 Tf
1.9707 0 TD
<009b>Tj
/TT6 1 Tf
0.5 0 TD
(s;)Tj
-2.4707 -1.1667 TD
({)Tj
2 -1.1667 TD
(...)Tj
-4.5 -2.1 TD
0.0963 Tw
[(Related to this is the problem of type coercion.)-596.4(Consider that on some machines)]TJ
-2.5 -1.1667 TD
0.052 Tw
[(\(such as a PDP-11\), a character pointer may refer to an)15(y)-302.1(memory location b)20(ut an inte)15(ger)]TJ
T*
0.0114 Tw
[(pointer must point to an e)25(v)15(en)-261.4(address. )-250(Hence)-261.4(on a PDP-11, it is)]TJ
/TT4 1 Tf
25.9376 0 TD
0 Tw
(not)Tj
/TT6 1 Tf
1.5393 0 TD
0.0115 Tw
[(safe to coerce a char)20(-)]TJ
-27.4769 -1.1667 TD
0.1152 Tw
[(acter pointer to an inte)15(ger pointer and access the data as an inte)15(ger)55(.)-615.2(\(On a PDP-11, in)]TJ
T*
0.1057 Tw
[(f)10(act, this causes an error)55(.\) )-250.1(If)-355.8(such coercion must be done, mak)10(e)-355.8(i)0(t)-355.8(into a subroutine so)]TJ
T*
0.073 Tw
[(that it can be changed easily for dif)25(ferent computers.)-573(This problem is particularly acute)]TJ
T*
0 Tw
(with storage allocators; the approach used in)Tj
/TT4 1 Tf
18.0776 0 TD
(trnum)Tj
/TT6 1 Tf
2.6392 0 TD
(is to de)Tj
/TT7 1 Tf
2.8887 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
[(ne a ne)25(w)-250(type with)]TJ
-19.1616 -1.75 TD
(typedef char *ALIGN;)Tj
-5 -1.75 TD
0.0742 Tw
[(so, when it is mo)15(v)15(e)0(d)-324.3(from a V)135(AX to a PDP-11, the header )]TJ
/TT7 1 Tf
24.3799 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0743 Tw
(le need only be changed to)Tj
-24.936 -1.1667 TD
0 Tw
(say)Tj
5 -1.75 TD
(typedef int *ALIGN;)Tj
-5 -1.75 TD
[(\(in f)10(act, this is done by a conditional compilation rather than changing the )]TJ
/TT7 1 Tf
29.8152 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
(le.\))Tj
ET
endstream
endobj
26 0 obj
<<
/ProcSet [ /PDF /Text ]
/Font << /TT4 5 0 R /TT6 6 0 R /TT7 7 0 R /TT8 13 0 R >>
/ExtGState << /GS1 8 0 R >>
>>
endobj
27 0 obj
<<
/Type /Page
/Parent 9 0 R
/Resources 29 0 R
/Contents 28 0 R
>>
endobj
28 0 obj
<< /Length 5264 >>
stream
BT
/TT6 1 Tf
12 0 0 12 72 791.89 Tm
0 g
/GS1 gs
0 Tc
0 Tw
[(The C Journal)-12084(7)-333( )-14111(8/5/104)]TJ
ET
BT
12 0 0 12 102 755.8901 Tm
0.0064 Tw
[(This brings up another point -- byte ordering.)-506.4(Some computers, such as the V)135(AXen)]TJ
-2.5 -1.1667 TD
0.1454 Tw
[(and PDP-11)55(s, number bytes from right to left; others, such as the MC68000, number)]TJ
T*
0.0029 Tw
[(bytes from left to right.)-503(As a result, when bytes are read from inte)15(gers, the order in which)]TJ
T*
0.0506 Tw
[(the bytes are read is machine-dependent.)-550.6(The same is true of bits being accessed.)-550.7(If the)]TJ
T*
0.0042 Tw
(order is important, do the reading \(or accessing\) in a separate routine that can be modi)Tj
/TT7 1 Tf
34.4946 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
(ed)Tj
-35.0508 -1.1667 TD
[(should the program be mo)15(v)15(e)0(d)-250(t)0(o)-250(a)-250(machine that reads bytes in the opposite order)55(.)]TJ
2.5 -1.5167 TD
0.0071 Tw
[(Characters are also a source of frustration.)-507.1(A)-257.1(program cannot assume ASCII order)20(-)]TJ
-2.5 -1.1667 TD
0.0427 Tw
[(ing, or e)25(v)15(en)-292.8(a)-292.7(contiguous alphabet \(in EBCDIC, there are nonalphabetic characters inter)20(-)]TJ
T*
0.1091 Tw
[(spersed within the alphabet.\))-609.1(Hence, constructs such as the follo)25(wing, to capitalize the)]TJ
T*
0 Tw
(character in)Tj
/TT4 1 Tf
4.9409 0 TD
(c)Tj
/TT6 1 Tf
0.4438 0 TD
(:)Tj
-0.3848 -1.75 TD
(capital_c = c )Tj
/TT5 1 Tf
5.3667 0 TD
<00ef>Tj
/TT6 1 Tf
0.564 0 TD
[( a + A)111(;)]TJ
-10.9307 -1.75 TD
0.1557 Tw
[(should be a)20(v)20(oided since the)15(y)-405.7(are non-portable.)-655.7(Instead, use the functions \(or macros\))]TJ
0 -1.1667 TD
0 Tw
(de)Tj
/TT7 1 Tf
0.9438 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
(ned in <)Tj
/TT4 1 Tf
3.2856 0 TD
[(ctype)15(.h)]TJ
/TT6 1 Tf
2.8444 0 TD
(>; the ab)Tj
3.5073 0 TD
-0.014 Tc
0.029 Tw
(ove w)Tj
2.376 0 TD
0 Tc
0 Tw
(ould be written)Tj
-8.5134 -1.75 TD
(capital_c = toupper\(c\);)Tj
-5 -1.75 TD
0.0994 Tw
[(which will w)10(ork on all computers, since)]TJ
/TT4 1 Tf
16.9604 0 TD
0 Tw
(toupper)Tj
/TT6 1 Tf
3.4603 0 TD
0.0995 Tw
(is de)Tj
/TT7 1 Tf
1.9603 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0995 Tw
(ned appropriately on each com-)Tj
-22.9372 -1.1667 TD
0 Tw
[(puter)55(.)]TJ
2.5 -1.5167 TD
0.0883 Tw
[(Ev)15(en when using ASCII characters, there are certain common assumptions which)]TJ
-2.5 -1.1667 TD
0.1183 Tw
[(are quite dangerous.)-618.3(F)15(o)0(r)-368.3(instance, it is widely accepted that characters are all nonne)15(g-)]TJ
T*
0 Tw
[(ati)25(v)15(e)0(,)-250(and the end of )]TJ
/TT7 1 Tf
8.3457 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
-0.0001 Tc
0.0001 Tw
[(le mark)9.9(er is ne)14.9(gati)24.9(v)14.9(e)-0.1(.)-500.1(Hence, the test)]TJ
-3.9019 -1.75 TD
0 Tc
0 Tw
(if \(\(c = getchar\(\)\) < 0\){)Tj
2 -1.1667 TD
(...)Tj
-7 -1.75 TD
0.0177 Tw
(is true only at the end of )Tj
/TT7 1 Tf
10.094 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0177 Tw
[(le.)-517.7(On a V)135(AX, this is correct.)-517.7(But on a PDP-11, characters are)]TJ
-10.6501 -1.1667 TD
0.0189 Tw
[(really inte)15(gers in the range )]TJ
/TT5 1 Tf
10.9917 0 TD
0 Tw
<00ef>Tj
/TT6 1 Tf
0.564 0 TD
0.0189 Tw
[(128 to 127 inclusi)25(v)15(e)0(.)-518.9(I)0(n)-268.9(this case, the character will be sign-)]TJ
-11.5557 -1.1667 TD
0.0064 Tw
[(e)15(xtended before the test is made; so, the ab)]TJ
17.2248 0 TD
-0.015 Tc
0 Tw
(ove )Tj
1.6703 0 TD
0 Tc
0.0064 Tw
(test will be true when the character has the)Tj
-18.8951 -1.1667 TD
-0.0001 Tc
0.1007 Tw
[(high bit set, re)14.9(gardless of whether or not the end of )]TJ
/TT7 1 Tf
21.7482 0 TD
0 Tc
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
0.1007 Tw
[(le is reached.)-600.7(T)80(o)80( )-80(be)-350.7(safe, al)10(w)10(ays)]TJ
-22.3044 -1.1667 TD
0.0009 Tw
[(assume characters are sign-e)15(xtended when con)40(v)15(erted to inte)15(gers, and when using the stan-)]TJ
T*
0 Tw
(dard input-output package, use the end of )Tj
/TT7 1 Tf
16.8281 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
[(le mark)10(er e)15(xplicitly)65(,)-250(a)0(s)-250(i)0(n)]TJ
-12.3843 -1.75 TD
(if \(\(c = getchar\(\)\) == EOF\){)Tj
2 -1.1667 TD
(...)Tj
-7 -1.75 TD
[(which will w)10(ork on all machines.)]TJ
2.5 -1.5167 TD
0.1024 Tw
[(Related to this is the multicharacter constant.)-602.4(As characters are really short inte-)]TJ
-2.5 -1.1667 TD
0.2072 Tw
[(gers, man)15(y)-457.2(compilers allo)25(w)-457.2(s)0(e)25(v)25( )447.2(eral characters to be stored in one inte)15(ger)55(.)-707.2(H)0(o)25(w)0(e)25(v)25( )447.2(er)40(,)]TJ
T*
0.1604 Tw
[(because the order in which the characters are actually put into the inte)15(ger is machine)]TJ
T*
0.1903 Tw
[(dependent \(upon the w)10(ay the computer numbers its bytes\), this is an e)15(xtremely non-)]TJ
T*
0 Tw
[(portable construct.)-500(Use character strings instead to ensure portability)65(.)]TJ
/TT2 1 Tf
15.6105 -3.5 TD
(Conclusion)Tj
/TT6 1 Tf
-13.1105 -2.6833 TD
0.1093 Tw
(There is one tool that is quite useful in checking for non-portable constructs: the)Tj
-2.5 -1.1667 TD
0 Tw
(program)Tj
/TT4 1 Tf
3.822 0 TD
(lint)Tj
/TT6 1 Tf
1.3335 0 TD
0.1843 Tw
[(.)-684.3(This program will check for)40(,)-434.3(and report, constructs which might cause)]TJ
-5.1555 -1.1667 TD
0.135 Tw
[(problems when the program is ported to another machine or operating system.)-635(It also)]TJ
ET
endstream
endobj
29 0 obj
<<
/ProcSet [ /PDF /Text ]
/Font << /TT2 4 0 R /TT4 5 0 R /TT5 30 0 R /TT6 6 0 R /TT7 7 0 R >>
/ExtGState << /GS1 8 0 R >>
>>
endobj
30 0 obj
<<
/Type /Font
/Subtype /Type0
/BaseFont /OIHIPL+Times-Roman
/Encoding /Identity-H
/DescendantFonts [ 51 0 R ]
/ToUnicode 52 0 R
>>
endobj
31 0 obj
<<
/Type /Page
/Parent 9 0 R
/Resources 33 0 R
/Contents 32 0 R
>>
endobj
32 0 obj
<< /Length 2351 >>
stream
BT
/TT6 1 Tf
12 0 0 12 72 791.89 Tm
0 g
/GS1 gs
0 Tc
0 Tw
[(The C Journal)-12084(8)-333( )-14111(8/5/104)]TJ
ET
BT
12 0 0 12 72 755.8901 Tm
0.1207 Tw
[(reports e)15(xpressions the v)25(alues of which depend on the order of e)25(v)25(aluation. )-250(\(It)-370.7(may)65(,)-370.7(o)0(r)]TJ
0 -1.1667 TD
0.0723 Tw
[(may not, report use of the e)15(xtensions to C; that depends on whether or not the compiler)]TJ
T*
0.0756 Tw
[(recognizes them.\))-575.6(When run with the option)]TJ
/TT1 1 Tf
18.6629 0 TD
0 Tw
<00ef>Tj
/TT2 1 Tf
0.5698 0 TD
(p)Tj
/TT6 1 Tf
0.5562 0 TD
0.0756 Tw
[(,)-325.6(the standard input-output library func-)]TJ
-19.7888 -1.1667 TD
0.0837 Tw
[(tion calls are also check)10(ed for calling errors; when)]TJ
/TT1 1 Tf
21.1512 0 TD
0 Tw
<00ef>Tj
/TT2 1 Tf
0.5698 0 TD
(c)Tj
/TT6 1 Tf
0.7775 0 TD
0.0837 Tw
[(is gi)25(v)15(e)0(n)-333.7(type casts are v)15(ery care-)]TJ
-22.4985 -1.1667 TD
0.0643 Tw
[(fully check)10(ed; and when the )]TJ
/TT7 1 Tf
11.8351 0 TD
0 Tw
()Tj
/TT6 1 Tf
0.5562 0 TD
(ag)Tj
/TT1 1 Tf
1.2581 0 TD
<00ef>Tj
/TT2 1 Tf
0.5698 0 TD
(a)Tj
/TT6 1 Tf
0.8142 0 TD
0.0642 Tw
[(is gi)25(v)15(en, assignments that w)10(ould cause v)25(alues to be)]TJ
-15.0334 -1.1667 TD
0.0339 Tw
[(truncated \(such as mo)15(ving a)]TJ
/TT4 1 Tf
11.6233 0 TD
0 Tw
(long)Tj
/TT6 1 Tf
2.0617 0 TD
0.0339 Tw
(into an)Tj
/TT4 1 Tf
3.0673 0 TD
0 Tw
[(inte)40(g)10(e)0(r)]TJ
/TT6 1 Tf
2.7825 0 TD
0.0339 Tw
[(\))-283.9(are also reported.)-533.9(\(Be a)15(w)10(are the use of)]TJ
-19.535 -1.1667 TD
0 Tw
(these )Tj
/TT7 1 Tf
2.3277 0 TD
()Tj
/TT6 1 Tf
0.5562 0 TD
0.0229 Tw
[(ags v)25(aries from system to system; the ab)]TJ
16.3269 0 TD
-0.015 Tc
0 Tw
(ove )Tj
1.6868 0 TD
0 Tc
0.0229 Tw
[(applies to 4.2 BSD UNIX only)65(.\))]TJ
/TT4 1 Tf
13.4885 0 TD
0 Tw
(Lint)Tj
/TT6 1 Tf
-34.386 -1.1667 TD
[(will be e)15(xamined more closely in a future issue of)]TJ
/TT2 1 Tf
20.2013 0 TD
[(The C J)15(our)15(nal)]TJ
/TT6 1 Tf
6.4431 0 TD
-0.0006 Tc
(magazine.)Tj
-24.1445 -1.5167 TD
0 Tc
0.0498 Tw
[(This paper has e)15(xamined some of the w)10(ays programmers can mak)10(e)-299.8(their programs)]TJ
-2.5 -1.1667 TD
0.1153 Tw
[(more portable.)-615.3(As programs are mo)15(v)15(e)0(d)-365.3(from one machine to another)40(,)-365.3(these considera-)]TJ
T*
0 Tw
(tions become vital to writing useful programs.)Tj
/TT8 1 Tf
17.6435 -1.1667 TD
<0027>Tj
ET
endstream
endobj
33 0 obj
<<
/ProcSet [ /PDF /Text ]
/Font << /TT1 34 0 R /TT2 4 0 R /TT4 5 0 R /TT6 6 0 R /TT7 7 0 R /TT8 13 0 R >>
/ExtGState << /GS1 8 0 R >>
>>
endobj
34 0 obj
<<
/Type /Font
/Subtype /Type0
/BaseFont /OIHJAP+Times-Bold
/Encoding /Identity-H
/DescendantFonts [ 49 0 R ]
/ToUnicode 50 0 R
>>
endobj
35 0 obj
<<
/Type /FontDescriptor
/Ascent 750
/CapHeight 662
/Descent -250
/Flags 6
/FontBBox [ -168 -218 1000 898 ]
/FontName /OIHIPL+Times-Roman
/ItalicAngle 0
/StemV 84
/XHeight 450
/StemH 84
/FontFile2 36 0 R
>>
endobj
36 0 obj
<< /Filter /FlateDecode /Length 4831 /Length1 9352 >>
stream
HV
lTv{wlm0u].sg6ȇp`!)%
4?Hp#RW" H43Ro$~%k:DgΎZȑ8F*QO}^Mu>;xxM}m%@&gx/W"ա;M Z/mX6uq\4h:/
)7-9ZVirihuw CYlk_x|+9OE|;,!#,
F2Tm;z 5q#VB=uL7+th!HA67P/re݈oe@OpPXtfXj'DteHрe؈0ޭxO