[so] [Tema3][Linux] teste neportabile

Bogdan Sass bogdan.sass at catc.ro
Fri May 8 10:11:12 EEST 2009


Cosmin Ratiu wrote:
>
> 2009/5/8 dana apostol <dana.apostol at ccna.ro <mailto:dana.apostol at ccna.ro>>
>
>     Nu stiu daca a mai raportat cineva problema [personal nu am gasit]:
>
>     dar verificarile din check si clear se fac prin impartiri si alte
>     operatii la 4! (sizeof(int))... si nu e usor cand ai un sistem pe
>     64 de biti sa te prinzi ca eroarea survine de la acest fapt.
>     As propune macar un define size la inceputul testului sau in loc
>     de 4 inlocuit cu sizeof(int)...pe viitor. :)
>
>
> De aceea exista masinile virtuale, ca sa ai o platforma bine definita 
> de testare.
    Absolut de acord. Dar comentariul OP ramane valid - din cate imi 
aduc eu aminte, printre "best programming practices" se numara si 
evitarea de "magic numbers". Adica folosirea "sizeof(int)" in loc de "4".

    Pana la urma, scopul cursului este tocmai sa invatam sa scriem 
programe portabile, nu? Nu programe care merg doar pe o anumita masina 
virtuala, cand e vineri, 13, si luna e in primul patrar :P

-- 
Bogdan Sass
CCAI,CCSP,JNCIA-ER,CCIE #22221 (RS)
Information Systems Security Professional
"Curiosity was framed - ignorance killed the cat"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cursuri.cs.pub.ro/pipermail/so/attachments/20090508/60f05e17/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3287 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://cursuri.cs.pub.ro/pipermail/so/attachments/20090508/60f05e17/attachment.bin>


More information about the so mailing list