사이드바 영역으로 건너뛰기

게시물에서 찾기2006/07/25

3개의 게시물을 찾았습니다.

  1. 2006/07/25
    cygwin 사용중 설정한 부분
    종이한장
  2. 2006/07/25
    AIX PROC 에서 나오는 몇 가지 문제들...
    종이한장
  3. 2006/07/25
    GCC 4.0.2 와 AIX 5.3에서 발생하는 char형 문제
    종이한장

cygwin 사용중 설정한 부분

1.  cygwin.bat 파일

@echo off

C:
chdir C:cygwinbin

rem bash --login -i
rxvt -vb -fg grey -bg black -fn "Lucida Console" -sl 5000 -geometry 100x60 -e /bin/bash --login -i

2. .gvimrc
$ cat .gvimrc
set ruler
set smartindent
set cindent
set ai
set lines=48
set columns=100
set guifont=Bitstream_Vera_Sans_Mono:h10:cANSI
진보블로그 공감 버튼트위터로 리트윗하기페이스북에 공유하기딜리셔스에 북마크

AIX PROC 에서 나오는 몇 가지 문제들...

2005년 12월 9일 이글루 블로그에 적었던 글
--
1. pthread.h 를 include 하려면,

define=_POSIX_SOURCE 를 넣어라.

2. fd_set 에서 아래와 같은 에러가 발생하면,
define=_XOPEN_SOURCE_EXTENTED 를 추가하라!


Syntax error at line 169, column 5, file /home/hts/Nextware.20/comm.include/hts_trgw.h:
Error at line 169, column 5 in file /home/hts/Nextware.20/comm.include/hts_trgw.
h
   fd_set master_rfdset;   /* trgw global read fdset */
....1
PCC-S-02201, Encountered the symbol "fd_set" when expecting one of the following


<리눅스 /usr/include/features.h 중 일부>

/* These are defined by the user (or the compiler)
  to specify the desired environment:

  __STRICT_ANSI__  ISO Standard C.
  _ISOC99_SOURCE   Extensions to ISO C89 from ISO C99.
  _POSIX_SOURCE    IEEE Std 1003.1.
  _POSIX_C_SOURCE  If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2;
           if >=199309L, add IEEE Std 1003.1b-1993;
           if >=199506L, add IEEE Std 1003.1c-1995;
           if >=200112L, all of IEEE 1003.1-2004
  _XOPEN_SOURCE    Includes POSIX and XPG things.  Set to 500 if
           Single Unix conformance is wanted, to 600 for the
           upcoming sixth revision.
  _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions.
  _LARGEFILE_SOURCE    Some more functions for correct standard I/O.
  _LARGEFILE64_SOURCE  Additional functionality from LFS for large files.
  _FILE_OFFSET_BITS=N  Select default filesystem interface.
  _BSD_SOURCE      ISO C, POSIX, and 4.3BSD things.
  _SVID_SOURCE     ISO C, POSIX, and SVID things.
  _GNU_SOURCE      All of the above, plus GNU extensions.
  _REENTRANT       Select additionally reentrant object.
  _THREAD_SAFE     Same as _REENTRANT, often used by other systems.
  _FORTIFY_SOURCE  If set to numeric value > 0 additional security
           measures are defined, according to level.

  The `-ansi' switch to the GNU C compiler defines __STRICT_ANSI__.
  If none of these are defined, the default is to have _SVID_SOURCE,
  _BSD_SOURCE, and _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to
  199506L.  If more than one of these are defined, they accumulate.
  For example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE
  together give you ISO C, 1003.1, and 1003.2, but nothing else.

  These are defined by this file and are used by the
  header files to decide what to declare or define:

  __USE_ISOC99     Define ISO C99 things.
  __USE_POSIX      Define IEEE Std 1003.1 things.
  __USE_POSIX2     Define IEEE Std 1003.2 things.
  __USE_POSIX199309    Define IEEE Std 1003.1, and .1b things.
  __USE_POSIX199506    Define IEEE Std 1003.1, .1b, .1c and .1i things.
  __USE_XOPEN      Define XPG things.
  __USE_XOPEN_EXTENDED Define X/Open Unix things.
  __USE_UNIX98     Define Single Unix V2 things.
  __USE_XOPEN2K        Define XPG6 things.
  __USE_LARGEFILE  Define correct standard I/O things.
  __USE_LARGEFILE64    Define LFS things with separate names.
  __USE_FILE_OFFSET64  Define 64bit interface as default.
  __USE_BSD        Define 4.3BSD things.
  __USE_SVID       Define SVID things.
  __USE_MISC       Define things common to BSD and System V Unix.
  __USE_GNU        Define GNU extensions.
  __USE_REENTRANT  Define reentrant/thread-safe *_r functions.
  __USE_FORTIFY_LEVEL  Additional security measures used, according to level.
  __FAVOR_BSD      Favor 4.3BSD things in cases of conflict.
  The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are
  defined by this file unconditionally.  `__GNU_LIBRARY__' is provided
  only for compatibility.  All new code should use the other symbols
  to test for features.

  All macros listed above as possibly being defined by this file are
  explicitly undefined if they are not explicitly defined.
  Feature-test macros that are not defined by the user or compiler
  but are implied by the other feature-test macros defined (or by the
  lack of any definitions) are defined by the file.  */
진보블로그 공감 버튼트위터로 리트윗하기페이스북에 공유하기딜리셔스에 북마크

GCC 4.0.2 와 AIX 5.3에서 발생하는 char형 문제

2005년 12월 18일 이글루 블로그에 적었던 글.
--

1. 증상


2. 시스템환경에서 아래 코드를 실행시키게 되면 솔라리스(sparc)와 GNU/Linux (intel)에서는
c -1, n -1, size of c 1
uc 255, un 255, size of uc 1

결과를 볼 수 있으나, 1번 환경에서는
c 255, n 255, size of c 1
uc 255, un 255, size of uc 1
를 볼 수 있다.
signed char형이 signed int형으로 확장될 경우 sign bit는 그대로 확장되는 것이 정상이나 이상한 현상을 보인다.
확인한 결과, 옵션으로 -fsigned-char 를 주어야  솔라리스, 리눅스 환경에서의 결과와 같아짐.
아마도, 가져다 사용한 GCC 가 default option이 -funsigned-char로 동작하도록 빌드되어 있는것 같다.



#include
int
main(int argc, char *argv[])
{
  char c;
  int  n;
  c = 255;
  n = c;
  printf("c %d, n %d, size of c %dn", c, n, sizeof(c));
  unsigned char uc;
  int un;
  uc = 255;
  un = uc;
  printf("uc %x, un %x, size of uc %dn", uc, un, sizeof(uc));
  return 0;
}

2. 시스템 환경

$ uname -a
AIX htstest 3 5 00CEBE7F4C00 unknown unknown AIX

$ gcc --version
gcc (GCC) 4.0.2
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


3. 결론

-fsigned-char 옵션을 사용하라!


--
종이한장
진보블로그 공감 버튼트위터로 리트윗하기페이스북에 공유하기딜리셔스에 북마크