troglobit / smcroute

Static multicast routing for UNIX
https://troglobit.com/projects/smcroute/
GNU General Public License v2.0
244 stars 64 forks source link

Build error on older GCC, e.g. 4.8.3 #165

Closed troglobit closed 3 years ago

troglobit commented 3 years ago

In SMCRoute 2.5.0, inline declarations from C99 were introduced. This caused older toolchains, like the sourcery-arm toolchain in Buildroot, to fail. Older GCC like 4.8.3 have -std=gnu90 as their default. This changed in later releases to gnu99.

Example:

mroute.c: In function 'mfc_install':
mroute.c:498:3: error: 'for' loop initial declarations are only allowed in C99 mode
   for (size_t i = 0; i < NELEMS(route->ttl); i++) {
   ^
mroute.c:498:3: note: use option -std=c99 or -std=gnu99 to compile your code