473,503 Members | 1,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: Static identifier => not reserved

>----------------------------- 8< ----------------------------------
>7.1.3 Reserved identifiers
[...]
— All identifiers with external linkage in any of the following
subclauses (including the future library directions) are always reserved
for use as identifiers with external linkage.

— Each identifier with file scope listed in any of the following
subclauses (including the future library directions) is reserved for use
as a macro name and as an identifier with file scope in the same name
space if any of its associated headers is included.
----------------------------- >8 ----------------------------------

Does this mean I'm allowed to give a STATIC function a name starting
with the str prefix ?
Not if you include <string.h>, in which case the second paragraph
above is an issue. Otherwise, it's OK.
>For instance, is the following code valid

------------- 8< ---------------
#include <stdio.h>

static size_t strlen(const char *s)
{
/* My own strlen() code */
}

int main(void)
{
printf("%lu\n",(unsigned long)strlen("blahblah"));

return 0;
}
------------- >8 ---------------

?
It's OK, but I think it would be less confusing if you named it
something else.

Jul 12 '08 #1
0 1424

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2145
by: Nice | last post by:
Hi. I read somewhere that in XML the tag <xml> is not legal. But in W3C specs I can't find this statement. Does anyone know about it ?
12
1980
by: Santiago de Compostela | last post by:
Hi The following program doesn't compile on MS VC++ or Bloodshed Dev-C++ #include <iostream> int strlen(const char *in) {
3
2213
by: Steven T. Hatton | last post by:
Sorry about the big code dump. I tried to get it down to the minimum required to demonstrate the problem. Although this is all done with GNU, I believe the problem I'm having may be more general. ...
34
2127
by: FMorales | last post by:
-- I didn't notice anything about this specifically -- in the c.l.c. FAQ, nor could i get a strait answere -- from my copy of the C standard. Hopeing someone -- here could shed some light on it...
7
4738
by: Tony | last post by:
I'm using XmlTextWriter to write XML to a string and XmlDocument to read it back. Every thing works OK except if my data contains a < or >. If this is the case they get saved as < > repectively....
4
6089
by: nospam_timur | last post by:
Let's say I have two files, myfile.h and myfile.c: myfile.h: int myfunction(int x); myfile.c: #include "myfile.h"
5
5029
by: ciccio | last post by:
Hi, I have a problem with my code that the compiler does not find any inline functions which are static. The simple code example is written below, this is what the compiler throws at me. ]...
4
2892
by: asit | last post by:
#include <stdio.h> typedef void show(int,int); int main() { static show myshow; myshow(1,100); //disp(1,5); return 0;
6
37999
by: muby | last post by:
Hi everybody :) I'm modifying a C++ code in VC++ 2005 my code snippet void BandwidthAllocationScheduler::insert( Message* msg, BOOL* QueueIsFull,
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7282
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5581
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5017
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1515
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
389
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.