Can we just abolish memset() and memcpy() and let the compiler work it out?
The only time these should ever be used is on a memory buffer of raw bytes.
The compiler could detect the formula "for (i = 0; i < X; ++i) buff[i]=0;"
where buff is an array of a built in type.

jm7


                                                                           
             Eric J Korpela                                                
             <[email protected]                                             
             eley.edu>                                                  To 
             Sent by:                  Nicolás Alvarez                     
             boinc_dev-bounces         <[email protected]>         
             @ssl.berkeley.edu                                          cc 
                                       [email protected]          
                                                                   Subject 
             08/27/2009 03:41          Re: [boinc_dev] Segfault in         
             PM                        boinc_get_init_data.                
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




> parse_init_data clears the APP_INIT_DATA structure using memset,
corrupting
> the internal structure of the std::string members.
>

Using memset() and memcpy() on classes or structures in C++ should be
abolished.

Just preaching to the choir again.
_______________________________________________
boinc_dev mailing list
[email protected]
http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
To unsubscribe, visit the above URL and
(near bottom of page) enter your email address.



_______________________________________________
boinc_dev mailing list
[email protected]
http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
To unsubscribe, visit the above URL and
(near bottom of page) enter your email address.

Reply via email to