avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avrdude-dev] [bug #35265] Findings reported by cppcheck


From: Rene Liebscher
Subject: [avrdude-dev] [bug #35265] Findings reported by cppcheck
Date: Mon, 09 Jan 2012 20:11:12 +0000
User-agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7

Follow-up Comment #2, bug #35265 (project avrdude):

command line was 'cppcheck --enable=all .'

cppcheck version is 'Cppcheck 1.49'

'Our' usleep is the old posix usleep (except on Windows were we have a
replacement in ppiwin.c).

But: POSIX.1-2001 declares this function obsolete; use       nanosleep(2)
instead.  POSIX.1-2008 removes the specification of usleep(). (see
https://www.kernel.org/doc/man-pages/online/pages/man3/usleep.3.html)

So we better replace all occurrences of usleep by an own wrapper microsleep.
To use nanosleep we have check it in the configure file.

I would put this wrapper in a new C-file (avrdude.c?, as we have an avrdude.h
defining a usleep for Windows.) I also would move the implementations of
usleep and gettimeofday from ppiwin.c to this new file as they are used not
only by the parallel port programmers. 

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?35265>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]