__alignof__ man page on NetBSD

Man page or keyword search:  
man Server   9087 pages
apropos Keyword Search (all sections)
Output format
NetBSD logo
[printable version]

__ALIGNOF__(3)		 BSD Library Functions Manual		__ALIGNOF__(3)

NAME
     __alignof__ — GNU extension for alignment of an object

SYNOPSIS
     int
     __alignof__(void x);

DESCRIPTION
     The __alignof__() operator returns the alignment of its operand.  The op‐
     erand can be a type or an expression.  If the operand is a ‘lvalue’, the
     return value represents the required alignment of the underlying type,
     not the actual alignment of the specified ‘lvalue’.

     The returned value is specific to the architecture and the ABI.  If the
     architecture does not impose strict alignment requirements, __alignof__()
     returns the minimum required alignment.  If __aligned(3) is used to
     increase the alignment, __alignof__() returns the specified alignment.

EXAMPLES
     The syntax is comparable to the sizeof() operator.	 If the architecture
     aligns integers along 32-bit address boundaries, the following should
     print the value 4.

	   (void)printf("%d\n", __alignof__(int));

     On the other hand, the following example should print the value 1, even
     though this is unlikely to be the actual alignment of the structure mem‐
     ber.

	   struct align {
		   int	x;
		   char y;
	   } a;

	   (void)printf("%d\n", __alignof__(a.y));

SEE ALSO
     gcc(1), attribute(3), offsetof(3), typeof(3)

CAVEATS
     This is a non-standard, compiler-specific extension.

BSD			       December 20, 2010			   BSD
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server NetBSD

List of man pages available for NetBSD

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net