Print this page
12705 remove __builtin_alloca() declaration from string.h

Split Close
Expand all
Collapse all
          --- old/usr/src/head/string.h
          +++ new/usr/src/head/string.h
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  24   24   * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
       25 + * Copyright 2020 Joyent, Inc.
  25   26   */
  26   27  
  27   28  /*      Copyright (c) 1988 AT&T */
  28   29  /*        All Rights Reserved   */
  29   30  
  30   31  #ifndef _STRING_H
  31   32  #define _STRING_H
  32   33  
  33   34  #include <iso/string_iso.h>
  34   35  
↓ open down ↓ 97 lines elided ↑ open up ↑
 132  133  #endif /* defined(__EXTENSIONS__)... */
 133  134  
 134  135  #if defined(__EXTENSIONS__) || \
 135  136          (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
 136  137          defined(_XPG4_2)
 137  138  extern char *strdup(const char *);
 138  139  #endif
 139  140  
 140  141  #if defined(__EXTENSIONS__) || \
 141  142          (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
      143 +
 142  144  #if defined(__GNUC__)
 143  145  
 144      -/*
 145      - * gcc provides this inlining facility but Studio C does not.
 146      - * We should use it exclusively once Studio C also provides it.
 147      - */
 148      -extern void *__builtin_alloca(size_t);
 149      -
 150  146  #define strdupa(s)                                                      \
 151  147          (__extension__(                                                 \
 152  148          {                                                               \
 153  149          char *__str = (char *)(s);                                      \
 154  150          strcpy((char *)__builtin_alloca(strlen(__str) + 1), __str);     \
 155  151          }))
 156  152  
 157  153  #define strndupa(s, n)                                                  \
 158  154          (__extension__(                                                 \
 159  155          {                                                               \
↓ open down ↓ 39 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX