Changeset 474 for trunk/src


Ignore:
Timestamp:
May 30, 2015, 7:57:16 PM (10 years ago)
Author:
katerina
Message:

Fix for ticket #372 (Replace obsolete smatch by clang in test suite).

Location:
trunk/src
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/cutest_sh_unix.c

    r237 r474  
    4242      CuAssertPtrNotNull(tc, buf);
    4343#ifndef USE_SYSTEM_MALLOC
     44#ifndef __clang__
    4445      CuAssertIntEquals (tc, malloc_count, (i_malloc + 1));
     46#endif
    4547#endif
    4648      free(buf);
  • trunk/src/sh_err_console.c

    r379 r474  
    328328  /* --- daemon && initialized ---
    329329   */
    330   if ( (OnlyStderr == S_FALSE) )
     330  if ( OnlyStderr == S_FALSE )
    331331    {
    332332      fd[0] = open ( sh.srvcons.name, O_WRONLY|O_APPEND|O_NOCTTY|O_NONBLOCK);
     
    340340      }
    341341
    342       if (sh.srvcons.alt != NULL && sh.srvcons.alt[0] != '\0')
     342      if (sh.srvcons.alt[0] != '\0')
    343343        {
    344344          fd[1] = open (sh.srvcons.alt, O_WRONLY|O_APPEND|O_NOCTTY|O_NONBLOCK);
  • trunk/src/sh_gpg.c

    r454 r474  
    419419  /* use homedir of effective user
    420420   */
    421   if (sh.effective.home != NULL)
    422     {
    423       len = sl_strlen(sh.effective.home) + 6;
    424       envp[0] = calloc(1, len); /* free() ok   */
    425       if (envp[0] != NULL)
     421  len = sl_strlen(sh.effective.home) + 6;
     422  envp[0] = calloc(1, len); /* free() ok   */
     423  if (envp[0] != NULL)
    426424        sl_snprintf (envp[0], len, _("HOME=%s"), sh.effective.home);
    427       envp[1] = NULL;
    428     }
    429   else
    430     {
    431       envp[0] = NULL;
    432     }
     425  envp[1] = NULL;
    433426
    434427  /* Create the pipe
  • trunk/src/sh_hash.c

    r463 r474  
    17511751    }
    17521752         
    1753   if (buf != NULL && buf->fullpath != NULL) {
     1753  if (buf != NULL) {
    17541754
    17551755    old_len = sl_strlen(buf->fullpath);
     
    30993099        theFile->fullpath, fileHash, p->theFile.checksum));
    31003100
    3101   if ( (fileHash != NULL) && (p->theFile.checksum != NULL)   &&
     3101  if ( (fileHash != NULL) &&
    31023102       (strncmp (fileHash, p->theFile.checksum, KEY_LEN) != 0) &&
    31033103       (theFile->check_mask & MODI_CHK) != 0)
  • trunk/src/sh_inotify.c

    r465 r474  
    2222#if defined(HAVE_SYS_INOTIFY_H)
    2323
    24 #if defined(GCC_VERSION_MAJOR)
     24#if defined(GCC_VERSION_MAJOR) && !defined(__clang__)
    2525#if (GCC_VERSION_MAJOR > 4) || ((GCC_VERSION_MAJOR == 4) && (GCC_VERSION_MINOR > 8))
    2626#pragma GCC diagnostic ignored "-Wclobbered"
  • trunk/src/sh_nmail.c

    r465 r474  
    2424#endif
    2525
    26 #if defined(GCC_VERSION_MAJOR)
     26#if defined(GCC_VERSION_MAJOR) && !defined(__clang__)
    2727#if (GCC_VERSION_MAJOR > 4) || ((GCC_VERSION_MAJOR == 4) && (GCC_VERSION_MINOR > 8))
    2828#pragma GCC diagnostic ignored "-Wclobbered"
  • trunk/src/sh_srp.c

    r473 r474  
    8686int    siz_str_internal = 0;
    8787
    88 inline
     88static
    8989char * big_string (bignum * a, int base)
    9090{
  • trunk/src/sh_suidchk.c

    r458 r474  
    203203  ShSuidchkSeverity = SH_ERR_SEVERE;
    204204  if (ShSuidchkExclude != NULL)
    205     sh_suid_exclude_free(ShSuidchkExclude);
     205    sh_suid_exclude_free();
    206206
    207207  FileLimNow        = 0;
  • trunk/src/sh_tiger1_64.c

    r451 r474  
    55#include "config_xor.h"
    66
     7#if defined(__clang__)
     8#undef TIGER_OPT_ASM
     9#endif
     10
    711#if defined(TIGER_64_BIT)
    812
    9 #if defined(GCC_VERSION_MAJOR)
     13#if defined(GCC_VERSION_MAJOR) && !defined(__clang__)
    1014#if ((GCC_VERSION_MAJOR == 4) && (GCC_VERSION_MINOR > 6))
    1115#pragma GCC optimize ("O1")
    1216#endif
    1317#endif
     18
    1419
    1520/* #if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64) */
  • trunk/src/sh_unix.c

    r473 r474  
    972972
    973973  SL_ENTER(_("sh_unix_self_check"));
    974   if (sh.exec.path == NULL || sh.exec.path[0] == '\0')
     974  if (sh.exec.path[0] == '\0')
    975975    SL_RETURN((0), _("sh_unix_self_check"));
    976976
  • trunk/src/sh_utmp.c

    r383 r474  
    319319  SL_ENTER(_("sh_utmp_setutent"));
    320320
    321   ASSERT((sh_utmppath != NULL), _("sh_utmppath != NULL"));
    322 
    323   if (sh_utmppath == NULL)
    324     SL_RET0(_("sh_utmp_setutent"));
    325 
    326321  if (sh_utmpfile == NULL)
    327322    {
  • trunk/src/trustfile.c

    r454 r474  
    211211#define SL_ALWAYS_TRUSTED  0
    212212#endif
    213 static uid_t test_rootonly[] = { SL_ALWAYS_TRUSTED };
     213uid_t test_rootonly[] = { SL_ALWAYS_TRUSTED };
    214214
    215215#define tf_uid_neg ((uid_t)-1)
  • trunk/src/zAVLTree.c

    r465 r474  
    3939  return (zAVLKey) arg;
    4040}
     41
    4142static char * dummy_zfree_string;
     43#ifdef __clang__
     44static char * dummy_zfree_str;
     45#endif
     46
    4247static void zfree_string (void * inptr)
    4348{
     49#ifdef __clang__
     50  dummy_zfree_str = (char *) inptr;
     51#else
    4452  char * str = (char *) inptr;
     53#endif
    4554
    4655  /* Take the address to circumvent gcc 4.9 optimizer bug */
    4756  dummy_zfree_string = (char *) &inptr;
    4857
     58#ifdef __clang__
     59  dummy_zfree_str[0] = '\0';
     60  free (dummy_zfree_str);
     61#else
    4962  str[0] = '\0';
    5063  free (inptr);
     64#endif
    5165  return;
    5266}
     
    537551  if (avlnode->right)
    538552    zAVLFreeBranch(avlnode->right, freeitem);
    539   if (freeitem)
     553  if (freeitem) {
    540554    freeitem(avlnode->item);
     555    avlnode->item = NULL;
     556  }
    541557  free(avlnode);
    542558}
Note: See TracChangeset for help on using the changeset viewer.