[Bug web/81560] New: Error in C documentation regarding min/max substitute macros MIN/MAX

um4711 at mutluit dot com gcc-bugzilla@gcc.gnu.org
Wed Jul 26 11:59:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81560

            Bug ID: 81560
           Summary: Error in C documentation regarding min/max substitute
                    macros MIN/MAX
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: web
          Assignee: unassigned at gcc dot gnu.org
          Reporter: um4711 at mutluit dot com
  Target Milestone: ---

On this documentation page an example for defining a macro MIN(X,Y) is given:
https://gcc.gnu.org/onlinedocs/gcc-3.4.2/gcc/Min-and-Max.html

There is a bug in the definition. It reads:

#define MIN(X,Y) ((X) < (Y) ? : (X) : (Y))

It can't compile; it of course needs to be changed to:

#define MIN(X,Y) ((X) < (Y) ? (X) : (Y))


More information about the Gcc-bugs mailing list