Compiling with -std=c99

70 views
Skip to first unread message

John Blaiklock

unread,
Apr 10, 2021, 12:45:04 PM4/10/21
to bcm2835
I've seen a few posts where people have reported compile errors when -std=c99 is defined for gcc. Here are two minor changes that can be made and the code compiles without warning or error for C99:

1) In bcm2835.c before all the #includes add this line...

#define _POSIX_C_SOURCE 200809L

2) In bcm2835.h add this line:

#include <fcntl.h>

May be these can go in a future release?


Mike McCauley

unread,
Apr 13, 2021, 9:58:10 PM4/13/21
to bcm2835, John Blaiklock
Thanks for reporting this John.

Your patch will be in the next release.

Cheers.
--
Mike McCauley VK4AMM mi...@airspayce.com
Airspayce Pty Ltd 9 Bulbul Place Currumbin Waters QLD 4223 Australia
http://www.airspayce.com 5R3MRFM2+X6
Phone +61 7 5598-7474



Reply all
Reply to author
Forward
0 new messages