On Tue, 2008-02-12 at 15:36 -0700, Andrew Ayre wrote: > The first time the compiler comes across the function it doesn't know > the prototype, so it assumes that it returns an int. Then when it comes > across the function declaration it is different. > > The "type" of a function is defined by the return type and the parameter > types which must always match when the function is declared and when it > is defined. > > Add the following after the #include but before the main function: > > unsigned short CRC16(unsigned char *puchMsg, unsigned short usDataLen); > > This will define the function so nothing is assumed by the compiler. > > Andy
Thanks, Andy and Ken. I seem to recall from another life long ago that main usually went at the bottom of C files. Now I know why, and how to cheat. I found this website to check my CRC program: http://www.lammertbies.nl/comm/info/crc-calculation.html?crc=104100000102FF00&method=hex and we agree. 10 41 00 00 01 02 FF 00 CRC16's to CF F1 , cool. -- Kirk Wallace (California, USA http://www.wallacecompany.com/machine_shop/ Hardinge HNC lathe, Bridgeport mill conversion, doing XY now, Zubal lathe conversion pending) ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users