Penguin
Diff: PortabilityNotes
EditPageHistoryDiffInfoLikePages

Differences between current version and predecessor to the previous major change of PortabilityNotes.

Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History

Newer page: version 4 Last edited on Monday, April 23, 2007 2:43:10 pm by AristotlePagaltzis
Older page: version 2 Last edited on Friday, July 7, 2006 9:44:30 am by AristotlePagaltzis Revert
@@ -104,8 +104,12 @@
  $ VAR2=bar; export VAR2 
  $ echo $VAR2 
  bar 
  </verbatim> 
+  
+!! See also  
+  
+* [What to watch out for when writing portable shell scripts | http://programming.newsforge.com/article.pl?sid=04/03/01/1554205], a useful article on NewsForge  
  
 ---- 
  
 !!! [Shell] tools 
@@ -154,12 +158,15 @@
  <verbatim> 
  uint64_t x; 
  printf("%"PRIu64,x); 
  </verbatim> 
+  
+! Avoid using other peoples types in your headers  
+Other peoples types change in size, sometimes at the flick of a #define. One example is off_t changes if LARGEFILE64 is defined under Linux. Use the c99 <tt><stdint.h></tt> types (uint64_t) so that they don't vary. If you absolutely must reference someone elses type, do so via a pointer (eg FILE*) and treat it as opaque.  
  
 !! See also 
  
 * [HP] has [a set of C portability notes | http://docs.hp.com/en/5074/portability.html], although it targets HP-UX. 
 * [Intel] has [a similar set of notes | http://www.intel.com/cd/ids/developer/asmo-na/eng/technologies/64bit/200519.htm?page=1] (for porting to [ia64] and [amd64]) 
  
 ---- 
 Part of CategoryProgramming