[Top][All Lists]

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

[avr-libc-dev] [bug #28058] parameter checking in pgm_read_xxx()

From: Jan Waclawek
Subject: [avr-libc-dev] [bug #28058] parameter checking in pgm_read_xxx()
Date: Wed, 28 Apr 2010 15:20:51 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv: Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729)

Follow-up Comment #1, bug #28058 (project avr-libc):

I would also propose adding the following function to <avr/pgmspace.h>, to
allow for proper reading of PROGMEM char-s

__attribute__((__always_inline__)) static char pgm_read_char(PGM_P);
static char pgm_read_char(PGM_P addr) {
  return (char)(__LPM((uint16_t)(addr)));

[Please note that in my initial submission, the markup feature eat up the
double-underscores around __attribute__ and __always_inline__ to single

Jan Waclawek


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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