Changeset 07e9194e in rtems


Ignore:
Timestamp:
Mar 5, 2004, 6:24:24 PM (16 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
1cf0ea1
Parents:
120b59e
Message:

2004-03-05 Joel Sherrill <joel@…>

  • libcsupport/src/newlibc.c, libcsupport/src/sync.c: Eliminate warnings. Explicitly defeat STRICT_ANSI since both legitimately use routines beyond ANSI.
Location:
cpukit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r120b59e r07e9194e  
     12004-03-05      Joel Sherrill <joel@OARcorp.com>
     2
     3        * libcsupport/src/newlibc.c, libcsupport/src/sync.c: Eliminate
     4        warnings.  Explicitly defeat __STRICT_ANSI__ since both
     5        legitimately use routines beyond ANSI.
     6
    172004-03-05      Joel Sherrill <joel@OARcorp.com>
    28
  • cpukit/libcsupport/src/newlibc.c

    r120b59e r07e9194e  
    2323#if defined(RTEMS_NEWLIB)
    2424#include <rtems/libcsupport.h>
     25
     26/* Since we compile with strict ANSI we need to undef it to get
     27 * prototypes for extensions
     28 */
     29#undef __STRICT_ANSI__
     30
    2531#include <stdlib.h>             /* for free() */
    2632#include <string.h>             /* for memset() */
     
    127133 
    128134#ifdef __GNUC__
    129           /* GCC extension: structure constants */
    130           _REENT_INIT_PTR((ptr));
     135      /* GCC extension: structure constants */
     136      _REENT_INIT_PTR((ptr));
    131137#else
    132           /*
    133            *  WARNING: THIS IS VERY DEPENDENT ON NEWLIB!!!
    134            *           Last visual check was against newlib 1.8.2 but last known
    135            *           use was against 1.7.0.  This is basically an exansion of
    136            *           REENT_INIT() in <sys/reent.h>.
    137            */
    138           memset(ptr, 0, sizeof(*ptr));
    139           ptr->_stdin = &ptr->__sf[0];
    140           ptr->_stdout = &ptr->__sf[1];
    141           ptr->_stderr = &ptr->__sf[2];
    142           ptr->_current_locale = "C";
    143           ptr->_new._reent._rand_next = 1;
    144 #endif
    145 
    146           creating_task->libc_reent = ptr;
    147           return TRUE;
    148   }       
     138      /*
     139       *  WARNING: THIS IS VERY DEPENDENT ON NEWLIB!!!
     140       *           Last visual check was against newlib 1.8.2 but last known
     141       *           use was against 1.7.0.  This is basically an exansion of
     142       *           REENT_INIT() in <sys/reent.h>.
     143       */
     144      memset(ptr, 0, sizeof(*ptr));
     145      ptr->_stdin = &ptr->__sf[0];
     146      ptr->_stdout = &ptr->__sf[1];
     147      ptr->_stderr = &ptr->__sf[2];
     148      ptr->_current_locale = "C";
     149      ptr->_new._reent._rand_next = 1;
     150#endif
     151
     152      creating_task->libc_reent = ptr;
     153      return TRUE;
     154  }
    149155  else
    150156      return FALSE;
     
    236242  }
    237243
    238   /* if (ptr) */
    239244  if (ptr && ptr != &libc_global_reent) {
    240245/*
     
    249254    free(ptr);
    250255#else
    251         _Workspace_Free(ptr);
     256    _Workspace_Free(ptr);
    252257#endif
    253258  }
  • cpukit/libcsupport/src/sync.c

    r120b59e r07e9194e  
    2222#endif
    2323
     24/* Since we compile with strict ANSI we need to undef it to get
     25 * prototypes for extensions
     26 */
     27#undef __STRICT_ANSI__
     28int fdatasync(int);        /* still not always prototyped */
     29
     30
    2431#include <unistd.h>
    2532#include <stdio.h>
     
    3542/* XXX check standards -- Linux version appears to be void */
    3643void _fwalk(struct _reent *, void *);
     44
    3745
    3846static void sync_wrapper(FILE *f)
     
    6169int sync(void)
    6270{
     71  extern struct _reent libc_global_reent;
     72
     73  /*
     74   *  Walk the one used initially by RTEMS.
     75   */
     76  _fwalk(&libc_global_reent, sync_wrapper);
     77
     78  /*
     79   *  XXX Do we walk the one used globally by newlib?
     80   *  XXX Do we need the RTEMS global one?
     81   */
     82
     83  /*
     84   *  Now walk all the per-thread reentrancy structures.
     85   */
    6386  rtems_iterate_over_all_threads(sync_per_thread);
     87
    6488  return 0;
    6589}
Note: See TracChangeset for help on using the changeset viewer.