Project

General

Profile

Actions

Bug #12165

closed

lp: argument to 'alloca' may be too large

Added by Toomas Soome almost 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Build errors with gcc 9:

    In file included from ../common/service.c:38:
    ../common/service.c: In function 'detailed_error':
    /code/illumos-gate/proto/root_i386/usr/include/alloca.h:57:19: error: argument to 'alloca' may be too large [-Werror=alloca-larger-than=]
       57 | #define alloca(x) __builtin_alloca(x)
          |                   ^~~~~~~~~~~~~~~~~~~
    ../common/service.c:387:19: note: in expansion of macro 'alloca'
      387 |    if ((message = alloca(size)) != NULL)
          |                   ^~~~~~

    In file included from ../common/service.c:40:
    ../common/service.c: In function 'detailed_error':
    /code/illumos-gate/proto/root_i386/usr/include/alloca.h:57:19: error: argument to 'alloca' may be too large [-Werror=alloca-larger-than=]
       57 | #define alloca(x) __builtin_alloca(x)
          |                   ^~~~~~~~~~~~~~~~~~~
    ../common/service.c:562:19: note: in expansion of macro 'alloca'
      562 |    if ((message = alloca(size)) != NULL)
          |                   ^~~~~~

    ../common/service.c: In function 'detailed_error':
    /code/illumos-gate/proto/root_i386/usr/include/alloca.h:57:19: error: argument to 'alloca' may be too large [-Werror=alloca-larger-than=]
       57 | #define alloca(x) __builtin_alloca(x)
          |                   ^~~~~~~~~~~~~~~~~~~
    ../common/service.c:292:19: note: in expansion of macro 'alloca'
      292 |    if ((message = alloca(size)) != NULL)
          |                   ^~~~~~

    In file included from service.c:34:
    service.c: In function 'detailed_error':
    /code/illumos-gate/proto/root_i386/usr/include/alloca.h:57:19: error: argument to 'alloca' may be too large [-Werror=alloca-larger-than=]
       57 | #define alloca(x) __builtin_alloca(x)
          |                   ^~~~~~~~~~~~~~~~~~~
    service.c:296:19: note: in expansion of macro 'alloca'
      296 |    if ((message = alloca(size)) != NULL)
          |                   ^~~~~~
    cc1: all warnings being treated as errors

Allocate from heap instead.

Testing done: build/install/boot.

Actions

Also available in: Atom PDF