hashlib package

From the posting that started this thread:

The function is defined without an explicit return type, which means "implicit int" under C89 rules and "diagnostic required" under C99.

The existence of a (putatively) correct program at the other end of a link is not the issue: The problem is that the illustrative code shown in the manual is faulty. Here it is, again from the thread-originating post:

Note the unbalanced parentheses in the `if' statement and the four uses of `.' where `->' was intended. (It's a good thing I said "at least" three errors.)

I'm suggesting that you compile and test the actual code given in the manual. He who fails to follow the example of K&R risks becoming an example in the next edition of K&P.[*]

[*] Not Kernighan and Pike but Kernighan and Plauger "The Elements of Programming Style." Instances of faulty code are analyzed, not just for their faults but also for the underlying causes. The bad code comes from various published programming texts whose authors seem not to have insisted upon attribution ... A sobering must-read for any professional programmer.
--
Eric.Sosman@sun.com
Reply to
Eric Sosman
Loading thread data ...

They help those who write code exclusively for Unix relatives and derivatives to understand if they should learn how to use the library. I would have thought that that's a very useful thing to do. Non-standard C may be off-topic here, but it will be useful to many who use the library or read it's docs.

Reply to
Rob Thorpe

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.