Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#28447 - [glibc] include/sys/sysmacros.h 'minor' and 'major' macros

Attached to Project: Arch Linux
Opened by Simone (junki.gnu) - Wednesday, 15 February 2012, 13:25 GMT
Last edited by Dave Reisner (falconindy) - Wednesday, 15 February 2012, 18:45 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To No-one
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
System header sys/sysmacros.h defines a couple of macros,
namely 'minor' and 'macro', in lower-case form. So in these
two words are available in a source code to be used
as function name (or class member name in C++).

This is a glibc issue, so we should probably file a bug to them.

Steps to reproduce:
$ cat test.c
#include "stdlib.h"

void minor(int a, int b) {};

int main(void) { return EXIT_SUCCESS; }

$ gcc -fsyntax-only test.c
test.c:3:24: error: macro "minor" passed 2 arguments, but takes just 1
test.c:3:26: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token

In this case, sysmacros.h is implicitely included by stdlib.h, that
defines EXIT_SUCCESS. A dirty workaround would be a '#undef minor'.
This task depends upon

Closed by  Dave Reisner (falconindy)
Wednesday, 15 February 2012, 18:45 GMT
Reason for closing:  Not a bug
Comment by Dave Reisner (falconindy) - Wednesday, 15 February 2012, 18:14 GMT
Seems to me that you need to fix your code to not step on the toes of glibc. These macros have been around since glibc 2.3.3 (released in 2004).
Comment by Simone (junki.gnu) - Wednesday, 15 February 2012, 18:25 GMT
Yeah, probably ... do you think that it's a good idea to file a bug
to glibc?

You can close this bug. Thanks!

Loading...