Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

__unconst(3) [netbsd man page]

__UNCONST(3)						   BSD Library Functions Manual 					      __UNCONST(3)

NAME
__UNCONST -- compile time cast-away macro SYNOPSIS
#include <sys/cdefs.h> void __UNCONST(x); void __UNVOLATILE(x); DESCRIPTION
The __UNCONST() macro can be used to omit warnings produced by certain compilers when operating with pointers declared with the const type qualifier in a context without such qualifier. Examples include passing a pointer declared with the const qualifier to a function without such qualifier, and variable assignment from a const pointer to a non-const pointer. In the same vein, the __UNVOLATILE() macro can be used to exclude warnings related to the volatile type qualifier. IMPLEMENTATION NOTES
These macros are implemented by explicitly using unsigned long instead of intptr_t, a signed type guaranteed to hold a pointer. SEE ALSO
cc(1), cdefs(3) CAVEATS
As both macros may hide valid errors, their usage is not recommended unless there is a well-thought reason for a cast. A typical use case for __UNCONST() involve an API that does not follow the so-called ``const correctness'' even if it would be appropriate. Valid use cases of __UNVOLATILE() include passing a volatile pointer to memset(3). BSD
December 16, 2010 BSD

Check Out this Related Man Page

CDEFS(3)						   BSD Library Functions Manual 						  CDEFS(3)

NAME
cdefs -- common definitions and macros SYNOPSIS
#include <sys/cdefs.h> DESCRIPTION
The <sys/cdefs.h> header includes some common definitions and macros typical to the C language conventions of NetBSD. Among these are: o Certain C language properties and definitions that are versioned according to the support in compilers. Examples include the __func__ keyword and the restrict type qualifier from C99. o Macros and definitions specific to compilers, preprocessors, and linkers; see __CONCAT(3), __UNCONST(3), __insn_barrier(3), and attribute(3). o Utility macros provided for convenience; see __arraycount(3) and bits(3). The header also contains the __RCSID() and __KERNEL_RCSID() macros used for version control system (VCS) identifiers. Thus, all NetBSD source code files typically include <sys/cdefs.h>, included as the first thing right after any possible copyright texts; /*- * Copyright (c) 1984 John Doe * All rights reserved. * * Redistribution and use in source and binary forms, * with or without modification, are permitted. */ #include <sys/cdefs.h> __RCSID("$NetBSD: cdefs.3,v 1.3 2011/04/08 07:55:04 jruoho Exp $"); It is possible to identify the RCS keyword strings by using ident(1). SEE ALSO
ident(1), param(3), stddef(3), types(3), c(7) HISTORY
The <sys/cdefs.h> header was originally imported from 386BSD. BSD
April 8, 2011 BSD
Man Page

4 More Discussions You Might Find Interesting

1. Programming

Need a simple example of passing FILE pointers

Dear friends, can anybody pls tell me how to pass FILE pointer in c. I am so confused .. :confused: suppose I ve two function 1. file_open() 2. read_line() I want to call these function from main() function and in file_open() function it will open that file and in read_line()... (5 Replies)
Discussion started by: user_prady
5 Replies

2. Red Hat

cast from const void* to unsigned int loses precision

Hello everey one, here i am attempting to compile a c++ project .it's throughing the following errors. my machine details are as follows: Linux chmclozr0119 2.6.18-53.el5 #1 SMP Wed Oct 10 16:34:19 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux errors: ===== Generating... (0 Replies)
Discussion started by: mannam srinivas
0 Replies

3. What is on Your Mind?

New here

New here so I thought Id say hi (6 Replies)
Discussion started by: biggestmuscles
6 Replies

4. Shell Programming and Scripting

Text qualifier issue causing data alignment problem

Hello Everyone, I have a csv file with text qualifier as "" and data similar to below: "1","abc","address1","US" "2","def","address1 "characters in double-quote" address2","IND" "3","ghi","address1","UK" In above example, for record 2, we have an issue as in column3 contains double... (2 Replies)
Discussion started by: AnkitSenghani
2 Replies