老外对goto的幽默注释---goto的合理用法---
fohoo 2003-10-20 08:37:40 /* now we know the sizes, so allocate memory */
yuv_buffer = (unsigned char *) malloc(XDIM*YDIM);
if (!yuv_buffer)
goto free_all_memory; /* goto is one of the most underestimated instructions in C !!! */
divx_buffer = (unsigned char *) malloc(XDIM*YDIM*2); /* this should really be enough! */
if (!divx_buffer)
goto free_all_memory; /* actually, every program should contain a goto */
YDIM = YDIM*2/3; /* PGM is YUV 4:2:0 format, so height is *3/2 too much */
rgb_buffer = (unsigned char *) malloc(XDIM*YDIM*4);
if (!rgb_buffer)
goto free_all_memory; /* the more, the better! */