Programming in C www sources/links

|c|makefiles|C++|rtos|tmn/cmise/snmp/..|lpr/print|emacs|vi|IMAP|unix|sockets|tcl/tk|expect|NIS|corba|cde|perl|html|javascript|java|netscape|ascii|Quality

References, FAQs

google? q="C reference sheet" q=c faq
BJS personal concise C reference clisp ref
Intro to comp sci debugging song lyrics?

usenet c-faq top faq
faqs.org/C-faq
comp.lang.c c-faq c-faq

lex yacc

C++

C++ faq
alt.comp.lang.learn.c-c++ faq list
Bjarne Stroustrup Slashdot interview

C style

I'm looking for a coding standard which justifies each guideline.
C & C++ Style guides Rob Pike on Style C Ten Commandments

The Programmers Stone Customs & Practices look for the bit on Coding standards & style guides.

wiki ExtremeProgramming CodingConventions BadCodingStandards MeaningfulNames BadVariableNames

typedef - why?

Stoustrup and Schildt don't really say much about typedefs. Wonder why?

google? q="typedef+and+struct" q=typedef+struct
Valvano Developing Embedded Software in C Using ICC11/ICC12/Hiware chap9 Structures
comp.lang.c c-faq 2. struct, union, enum 2.1 diff between struct and typedef struct
C for Scientists and Engineers Chapter 10.1-10.4 Structures, Unions, and Enumerated Types
codeguru.developer.com MFC Programmer's Sourcebook Thinking in C++ Composite type Creation
www.cs.caltech.edu/~petrovic/games/archex/othellodir/typothello
IRIS Explorer data typing language (ETL) Chapter 8 - Creating user defined data types | Cxref

C++ STL

STL technology the S3 C++ Coding Standard

GNU gcc g++ docs

Notes socket|emacs|vi|IMAP|unix|NIS|cde|perl|html|javascript|java|netscape|Quality

C++ STL

STL technology the S3 C++ Coding Standard

GNU gcc/c++ in S3?

This becomes frequently out of date!
cadenv -l gcc
Package           Release     Version     Release date
-------           -------     -------     ------------
gcc               2.95.2      ---         Thu Apr  4 14:36:28 2002
gcc               mipsel-r3000-elfl  ---         Thu Apr  4 14:36:46 2002

cadenv -r gcc 2.95.2 # will set up links in your $CADENV_HOME
                     # $CADENV_HOME/cadbin should be in your $PATH 
/proj/npapi/cadence/cadbin/gcc is a script which sets up LIB path and others
Fine for compiling a few files but doesn't work when you wish to use
this gcc to build any downloaded tool using configure and make.
Look in the script, set the variables there in your environment,
put the real path to gcc in front of your PATH 

The setup seems to work a bit by magic. If I ever find out which library paths work I'll put them here. For now do "c++ -I/opt/FSFlibg++/lib/g++-include/ Hello.C" or see my .cshrc and .cshrc-sparc-sun-solaris2 for setup (BAD!) of LIB_PATH, etc....


  # should this now be /appli/gcc ?
  setenv GCC_DIR /opt/FSFgcc
  #  set path = ($path $GCC_DIR/bin $GCC_DIR/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2  )
  setenv MANPATH ${MANPATH}:$GCC_DIR/man
  # /appli/FSFlibg++/lib missing? use /opt/FSFlibg++/lib or /appli/gcc/lib/ ?
  setenv LD_LIBRARY_PATH $GCC_DIR/lib:/opt/FSFlibg++/lib:/appli/gcc/lib/:$GCC_DIR/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2
  setenv LIBPATH /usr/ccs/lib:/usr/lib:$LD_LIBRARY_PATH

# And what about the include path? c++ -I/opt/FSFlibg++/lib/g++-include/ Hello.C
/appli/gcc/info/ /appli/gcc/man/ manpage on web
/appli/gcc/bin/ /appli/gcc/lib/ /appli/gcc/include/
training?
versions? libg++-2.7.2 gcc-2.7.2.1 libstdc++-2.8.1 gcc-2.8.1 xxgdb-1.12

g++ docs

gcc error (gcc version is for Solaris 2.5, need Solaris 2.6 (zeus))

In file included from /usr/include/sys/stream.h:26,
                 from /usr/include/netinet/in.h:38,
                 from somethingyou'retryingtocompile.c:line:
/usr/include/sys/model.h:32: #error "No DATAMODEL_NATIVE specified"
get gcc-2.95.2? gnu ftp sites ftp://ftp.gnu.org ftp://gcc.gnu.org
ftp://ftp.esat.net/pub/gnu (ftp://193.120.14.241) (on zeus run netscape and use direct internet connection)

cygnus gdb


C++ Programming C++ Tutorial using gdb
quickref & refcard
aadebug

Makefiles

How to write a Makefile GNU make manual

automagic variables
$@ target file name   $% target member name
$< first dependancy   $? all dependancies newer     $^ all dependancies
$* stem

Cross compiling and compilers

MyrIAD binutils/gcc tool notes

GNU Binary Utilities and GCC tools

compiler gnu gcc 2.95.2 (manual: http://gcc.gnu.org/onlinedocs/gcc-2.95.2/gcc.html).
CrossGCC FAQ
linker and binutils gnu binutils 2.10 (manual: http://www.gnu.org/software/binutils/binutils.html).

PPC gnu tools

PenguinPPC.org cross-compiling for PPC Embedded PPC
Downloads: http://distro.ibiblio.org/pub/Linux/distributions/suse/people/olh/cross-ppc/ ftp://gcc.gnu.org/pub/gcc/releases/gcc-2.95.3/
cd ~/cross #/projects/npapi/users/jamesco/cross
tar zxf binutils-*.tar.gz
cd binutils-*
setenv INSTALL_DIR "~/install"
setenv INSTALL_DIR /projects/npapi/users/jamesco/install
mkdir -f $INSTALL_DIR
./configure --target=powerpc-linux --prefix=$INSTALL_DIR --exec_prefix=$INSTALL_DIR
make
make install

ls ../../install/
#bin  include  lib  man  powerpc-linux  share
cd ..
setenv PATH ${PATH}:$INSTALL_DIR/bin

tar zxf gcc-core-*.tar.gz
cd gcc-2.95.3
./configure --target=powerpc-linux --enable-shared --enable-languages=c --with-newlib --prefix=$INSTALL_DIR --exec_prefix=$INSTALL_DIR
make
make install

setenv MANPATH ${MANPATH}:$INSTALL_DIR/man
man powerpc-linux-gcc
Now, getting it to compile with PACE and vxworks.
cd ~/checkedout/source/sim_bapi
powerpc-linux-gcc ?-mppc680? -I .. -I$ACE_ROOT/PACE -DOSHEADERS_SIM bapisim.c

ls /projects/npapi/libs/ace/ace/con*

sh-2.05$ powerpc-linux-gcc -I/usr/include -DOSHEADERS_SIM -DACE_CONFIG_H=\"config-linux.h\" -DACE_PLATFORM_MACROS_GNU=platform_linux.GNU -DNPAPI_HOME=\"/projects/npapi/\" -DNPAPI_WORKDIR=\"/projects/npapi/users/jamesco/checkedout/source/\" -DNPAPI_USER_TMP=\"/projects/npapi/users/jamesco/tmp/\" -DOSAL_SIM -DDMAL_SIM -DUSE_SAFEMALLOC -W -Wall -Wpointer-arith -pipe -g -Wno-uninitialized -DPACE_LINUX=132096 -DPACE_LINUX=132096 -D_POSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS -D_REENTRANT -DACE_HAS_AIO_CALLS -I/projects/npapi/users/jamesco/checkedout/source -I/projects/npapi/libs -I/projects/npapi/libs/osUtils -I/projects/npapi/libs/ace -I/projects/npapi/libs/ace/PACE -DACE_HAS_EXCEPTIONS -DPACE_HAS_INLINE=1 -DACE_HAS_PACE -DPACE_HAS_ALL_POSIX_FUNCS -I/projects/npapi/libs/ace/PACE -c -MD -o .obj/portmanager.o portmanager.c >err 2>&1

objdumpppc -D .obj/portmanager.o


which asppc
/proj/npapi/users/jamesco/checkedout/vxworks/host/sun4-solaris2/bin
in path

ls $INSTALL_DIR/bin
ls $INSTALL_DIR/bin | sed "s/^\(powerpc-linux-\(.*\)\)/ln -s \1 \2ppc/"
cd $INSTALL_DIR/bin
ln -s powerpc-linux-addr2line addr2lineppc
ln -s powerpc-linux-ar arppc
ln -s powerpc-linux-as asppc
ln -s powerpc-linux-c++filt c++filtppc
ln -s powerpc-linux-gasp gaspppc
ln -s powerpc-linux-gcc gccppc
ln -s powerpc-linux-ld ldppc
ln -s powerpc-linux-nm nmppc
ln -s powerpc-linux-objcopy objcopyppc
ln -s powerpc-linux-objdump objdumpppc
ln -s powerpc-linux-protoize protoizeppc
ln -s powerpc-linux-ranlib ranlibppc
ln -s powerpc-linux-readelf readelfppc
ln -s powerpc-linux-size sizeppc
ln -s powerpc-linux-strings stringsppc
ln -s powerpc-linux-strip stripppc
ln -s powerpc-linux-unprotoize unprotoizeppc


ls /proj/npapi/users/jamesco/checkedout/vxworks/host/sun4-solaris2/bin/*ppc
/proj/npapi/users/jamesco/checkedout/vxworks/host/sun4-solaris2/bin/arppc
/proj/npapi/users/jamesco/checkedout/vxworks/host/sun4-solaris2/bin/asppc
/proj/npapi/users/jamesco/checkedout/vxworks/host/sun4-solaris2/bin/c++filtppc
/proj/npapi/users/jamesco/checkedout/vxworks/host/sun4-solaris2/bin/c++ppc
/proj/npapi/users/jamesco/checkedout/vxworks/host/sun4-solaris2/bin/ccppc
/proj/npapi/users/jamesco/checkedout/vxworks/host/sun4-solaris2/bin/g++ppc
/proj/npapi/users/jamesco/checkedout/vxworks/host/sun4-solaris2/bin/gaspppc
/proj/npapi/users/jamesco/checkedout/vxworks/host/sun4-solaris2/bin/gdbppc
/proj/npapi/users/jamesco/checkedout/vxworks/host/sun4-solaris2/bin/ldppc
/proj/npapi/users/jamesco/checkedout/vxworks/host/sun4-solaris2/bin/nmppc
/proj/npapi/users/jamesco/checkedout/vxworks/host/sun4-solaris2/bin/objcopyppc
/proj/npapi/users/jamesco/checkedout/vxworks/host/sun4-solaris2/bin/objdumpppc
/proj/npapi/users/jamesco/checkedout/vxworks/host/sun4-solaris2/bin/ranlibppc
/proj/npapi/users/jamesco/checkedout/vxworks/host/sun4-solaris2/bin/sizeppc
/proj/npapi/users/jamesco/checkedout/vxworks/host/sun4-solaris2/bin/stringsppc
/proj/npapi/users/jamesco/checkedout/vxworks/host/sun4-solaris2/bin/stripppc


ln -s $INSTALL_DIR/bin


on Linux, not solaris:

vxworks202withnptcheckout
setenv SRC /proj/npapi/Tornado2.0.2
setenv DST `pwd`/vxworks2_0_2_with_npt_and_routing_extensions
find $DST -type l -exec rm {} \;
ln -s $SRC/* $DST > /dev/null 2>&1

cd $SRC
setenv DIRS `find target/lib -type d -print`
sh
for DIR in $DIRS ; do ln -s $SRC/$DIR/* $DST/$DIR ; done > /dev/null 2>&1
exit
ln -s $SRC/target/* $DST/target
ln -s $SRC/target/src/* $DST/target/src

cd ${NPAPI_HOME}/users/$USER/checkedout
ln -s $DST vxworks

Xscale http://www.redhat.com/software/tools/gnupro/intel_xscale.html gnu tools/cygwin for arm/xscale

|c|makefiles|C++|rtos|tmn/cmise/snmp/..|lpr/print|emacs|vi|IMAP|unix|sockets|tcl/tk|expect|NIS|corba|cde|perl|html|javascript|java|netscape|ascii|Quality