Sponsored Content
Top Forums Programming help with atoi and macros in C Post 302509094 by omega666 on Tuesday 29th of March 2011 08:17:37 PM
Old 03-29-2011
Error help with atoi and macros in C

I have a PORT_NUM macro (10 digits long number)
in a server file, if i do
htons(PORT_NUM)
i get
warning: this decimal constant is unsigned only in ISO C90
warning: large integer implicitly truncated to unsigned type

whats wrong with this?

Last edited by omega666; 03-29-2011 at 09:24 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

troff macros

Hi, I'm going write a small handbook. The typesetting software I'm going to use is troff. There are -ms -me -mm macros for troff. Which one is the most suitable? Thanks! -Tony (2 Replies)
Discussion started by: tonyt
2 Replies

2. Programming

atoi

i know what is the use of atoi function.... converts string to int. but whenever i use that it gives me 0.... could any one help in this issue.. eg. int i; char str; str="name"; i=atoi(str); i gives me 0. why? (3 Replies)
Discussion started by: bankpro
3 Replies

3. UNIX for Dummies Questions & Answers

saving macros for VIM

The question is , as the topic says, how does one save macros for VIM in the .vimrc. I had a look on web and it gave all this ****** about how to build turing machines in vim code or something but i just want to store a macro to like : if(){ } I know how to do it IN vim but .vimrc??????!?!?!... (3 Replies)
Discussion started by: yngwie
3 Replies

4. Programming

How do capability macros get named?

The following is taken from some production code: #ifdef LOCK_LOCKF #ifdef HAVE_SYS_FILE_H #include <sys/lockf.h> #endif #ifdef HAVE_SYS_FILE_H #include <sys/file.h> #endif #define LOCK(file) fseek(file, 0L, 0), lockf(file, 1, 0L) #define UNLOCK(file) fseek(file, 0L, 0),... (2 Replies)
Discussion started by: frequency8
2 Replies

5. Programming

One last question about capability macros

This might be poorly worded. In the header file, I have #ifdef LOCK_FCNTL #ifdef HAVE_FCNTL_H #include <fcntl.h> #endif #define LOCK(file) setlock(fileno(file), F_WRLCK); #define UNLOCK(file) setlock(fileno(file), F_UNLCK); #endif /* LOCK_FCNTL */ #ifdef LOCK_FLOCK #ifdef... (1 Reply)
Discussion started by: frequency8
1 Replies

6. Shell Programming and Scripting

Expect Terminal Macros

Hey people! I just started out working at an ISP as tech support and thought that I should ease the work load by scripting some small macros. I create different commands with Alias through .bashrc which are all directed to the same script file. Here I planned on using Expect to run different... (0 Replies)
Discussion started by: GhettoFish
0 Replies

7. Linux

What are the meaning of these macros..

Masters, I am trying to learn the serial mouse driver for linux kernel. On the kernel source tree I find out these macros and I am unable to find out the meaning of these macros. Please anyone help me to understand these. These macros are defined in linux/serio.h... (2 Replies)
Discussion started by: iamjayanth
2 Replies

8. UNIX for Advanced & Expert Users

Using Macros in sftp command

Hi, I've some existing scripts wherein am using ftp + .netrc. I've defined my macros in .netrc file. I want to switch to sftp now but it seems it doesn't support macros and .netrc and it gives "command invalid" error. Is there any other alternative? Note: I don't want help for... (1 Reply)
Discussion started by: ps51517
1 Replies

9. Shell Programming and Scripting

Macros how-to?

Hi, all I just came to new system with RH, and it has alot of macros I was told to use, but I can't find how to open it for display or for edit, can you help me please, is it all about make/makefile? let say I have macro <trx> like this, that does a lot of things: >$ trx ... creating new... (1 Reply)
Discussion started by: trento17
1 Replies

10. Programming

type conversion C, atoi()

In the book "The C programming language"; second edition, chapter 2.7 there is a snippet which is supposed to: "convert a string of digits into its numeric equivalent". int atoi(char s) { int i, n; n = 0; for ( i = 0; s >= '0' && s <= '9'; ++i) n = 10 * n + (s -... (4 Replies)
Discussion started by: tornow
4 Replies
stdint(5)							File Formats Manual							 stdint(5)

NAME
stdint - integer types SYNOPSIS
DESCRIPTION
This header file defines sets of integer types having specified widths and corresponding sets of macros. It also defines macros that spec- ify limits of integer types corresponding to types defined in other standard headers. Since not all implementations are required to support all of the integer sizes defined in this manual page, the proper way to see if a par- ticular size of an integer is supported on the current implementation is to test the symbol that defines its maximum value. For example, if tests false, then that implementation does not support 64-bit unsigned signed integers. This header file defines the following integer data types for 8, 16, 32, and 64 bits. largest signed integer data type supported by implementation 8-bit signed integer 16-bit signed integer 32-bit signed integer 64-bit signed integer largest unsigned integer data type supported by implementation 8-bit unsigned integer 16-bit unsigned integer 32-bit unsigned integer 64-bit unsigned integer The following two data types are signed and unsigned integer data types that are large enough to hold a pointer. A pointer can be moved to or from these data types without corruption. signed integer type that is large enough to hold a pointer unsigned integer type that is large enough to hold a pointer This header file defines the following integer data types for determining the most efficient data types to use for integer values on a par- ticular implementation. most efficient signed integer data type supported by implementation most efficient signed integer of at least 8 bits most efficient signed integer of at least 16 bits most efficient signed integer of at least 32 bits most efficient signed integer of at least 64 bits most efficient unsigned integer data type supported by implementation most efficient unsigned integer of at least 8 bits most efficient unsigned integer of at least 16 bits most efficient unsigned integer of at least 32 bits most efficient unsigned integer of at least 64 bits This header file defines the following integer data types for compatibility with systems that do not fit the 16-bit or 32-bit word size model. These data types define the signed and unsigned integers of at least 8, 16, 32, and 64 bits. smallest signed integer of at least 8 bits smallest signed integer of at least 16 bits smallest signed integer of at least 32 bits smallest signed integer of at least 64 bits smallest unsigned integer of at least 8 bits smallest unsigned integer of at least 16 bits smallest unsigned integer of at least 32 bits smallest unsigned integer of at least 64 bits The following macros define the minimum and maximum values that can be stored in the above data types. minimum value that can be stored in the largest integer data type maximum value that can be stored in the largest signed integer data type maximum value that can be stored in the largest unsigned integer data type minimum value that can be stored in the most efficient integer data type maximum value that can be stored in the most efficient signed integer data type maximum value that can be stored in the most efficient unsigned integer data type minimum value that can be stored in an data type minimum value that can be stored in an data type minimum value that can be stored in an data type minimum value that can be stored in an data type maximum value that can be stored in an data type maximum value that can be stored in an data type maximum value that can be stored in an data type maximum value that can be stored in an data type maximum value that can be stored in an data type maximum value that can be stored in an data type maximum value that can be stored in an data type maximum value that can be stored in an data type" minimum value that can be stored in an data type minimum value that can be stored in an data type" minimum value that can be stored in an data type minimum value that can be stored in an data type maximum value that can be stored in an data type maximum value that can be stored in an data type maximum value that can be stored in an data type maximum value that can be stored in an data type minimum value that can be stored in an data type minimum value that can be stored in an data type minimum value that can be stored in an data type minimum value that can be stored in an data type maximum value that can be stored in an data type maximum value that can be stored in an data type maximum value that can be stored in an data type maximum value that can be stored in an data type The following macros specify the maximum and minimum limits of integer types corresponding to types defined in other standard headers. All these values are implementation defined. minimum value that can be stored in data type maximum value that can be stored in data type minimum value that can be stored in data type maximum value that can be stored in data type maximum value that can be stored in data type minimum value that can be stored in data type maximum value that can be stored in data type minimum value that can be stored in data type maximum value that can be stored in data type The following macros expand to integer constant expressions suitable for initializing objects that have integer types corresponding to types defined in header. Macros For Minimum-Width Integer Constant Expressions The macro expands to an integer constant expression corresponding to the type The macro expands to an integer constant expression corresponding to the type For example, if is a name for the type then might expand to the integer constant Macros For Greatest-Width Integer Constant Expressions The following macro expands to an integer constant expression having the value specified by its argument and the type The following macro expands to an integer constant expression having the value specified by its argument and the type FILES
SEE ALSO
inttypes(5), standards(5), <stddef.h>, <wchar.h>, <signal.h>. stdint(5)
All times are GMT -4. The time now is 04:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy