473,714 Members | 2,552 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is this code in gcc 4.3.1 valid C or is Sun compiler wrong ??

I'm having a hard time tying to build gcc 4.3.1 on Solaris using the GNU
compilers. I then decided to try to use Sun's compiler. The Sun Studio
12 compiler reports the following code, which is in the source
(gcc-4.3.1/gcc/c-common.c) of gcc 4.3.1, is a syntax error.
I'm inclined to agree, as it is like no C I have ever met.
what is "C_COMMON_FIXED _TYPES (, fract);" supposed to mean? Could it be
written in a different way so the Sun compiler could understand it? Or
are Sun at fault?
I'd certainly never write C code like this, but perhaps it is legal.

#define C_COMMON_FIXED_ MODE_TYPES(SAT, NAME) \
if (type1 == SAT ## NAME ## _type_node \
|| type1 == SAT ## u ## NAME ## _type_node) \
return unsignedp ? SAT ## u ## NAME ## _type_node \
: SAT ## NAME ## _type_node;

C_COMMON_FIXED_ TYPES (, fract); /* line 2254 */
C_COMMON_FIXED_ TYPES (sat_, fract);
C_COMMON_FIXED_ TYPES (, accum);
C_COMMON_FIXED_ TYPES (sat_, accum);


So is this really C, or is it just a GNU ism, which prevents the GNU C
compiler compiling with a compiler able to compiler C ?? I thought one
was supposed to need a C compiler to compile gcc, but perhaps I was
mistaken.

cc -c -g -DIN_GCC -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.3.1/gcc
-I../../gcc-4.3.1/gcc/. -I../../gcc-4.3.1/gcc/../include -I./../intl
-I../../gcc-4.3.1/gcc/../libcpp/include -I/usr/local/include
-I/usr/local/include -I/usr/local/include
-I../../gcc-4.3.1/gcc/../libdecnumber
-I../../gcc-4.3.1/gcc/../libdecnumber/dpd -I../libdecnumber
.../../gcc-4.3.1/gcc/c-common.c -o c-common.o
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token:
short_fract_typ e_no...
"../../gcc-4.3.1/gcc/c-common.c", line 2254: syntax error before or at: ||
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token:
unsigned_short_ frac...
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token:
unsigned_short_ frac...
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token:
short_fract_typ e_no...
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token: fract_type_node

Jun 27 '08 #1
27 3066
On 2008-06-10 07:37:28 +0100, Dave <fo*@coo.comsai d:
I'm having a hard time tying to build gcc 4.3.1 on Solaris using the
GNU compilers. I then decided to try to use Sun's compiler. The Sun
Studio 12 compiler reports the following code, which is in the source
(gcc-4.3.1/gcc/c-common.c) of gcc 4.3.1, is a syntax error.
I'm inclined to agree, as it is like no C I have ever met.
The ## stuff is normal ISO C token pasting, so SAT ## NAME ##
_type_node would get pre-processed as fract_type_node if SAT was not
set and NAME was fract.
what is "C_COMMON_FIXED _TYPES (, fract);" supposed to mean? Could it
be written in a different way so the Sun compiler could understand it?
Or are Sun at fault?
Hard to say.
>
I'd certainly never write C code like this, but perhaps it is legal.

#define C_COMMON_FIXED_ MODE_TYPES(SAT, NAME) \
if (type1 == SAT ## NAME ## _type_node \
|| type1 == SAT ## u ## NAME ## _type_node) \
return unsignedp ? SAT ## u ## NAME ## _type_node \
: SAT ## NAME ## _type_node;

C_COMMON_FIXED_ TYPES (, fract); /* line 2254 */
C_COMMON_FIXED_ TYPES (sat_, fract);
C_COMMON_FIXED_ TYPES (, accum);
C_COMMON_FIXED_ TYPES (sat_, accum);


So is this really C, or is it just a GNU ism, which prevents the GNU C
compiler compiling with a compiler able to compiler C ?? I thought one
was supposed to need a C compiler to compile gcc, but perhaps I was
mistaken.

cc -c -g -DIN_GCC -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.3.1/gcc
-I../../gcc-4.3.1/gcc/. -I../../gcc-4.3.1/gcc/../include -I./../intl
-I../../gcc-4.3.1/gcc/../libcpp/include -I/usr/local/include
-I/usr/local/include -I/usr/local/include
-I../../gcc-4.3.1/gcc/../libdecnumber
-I../../gcc-4.3.1/gcc/../libdecnumber/dpd -I../libdecnumber
../../gcc-4.3.1/gcc/c-common.c -o c-common.o
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token:
short_fract_typ e_no...
I can't see any "short" in the macro you quoted. It may be worth adding
-E to the cc flags and looking more closely at the preprocessor output.

Cheers,

Chris

Jun 27 '08 #2
Chris Ridd wrote:
On 2008-06-10 07:37:28 +0100, Dave <fo*@coo.comsai d:
>I'm having a hard time tying to build gcc 4.3.1 on Solaris using the
GNU compilers. I then decided to try to use Sun's compiler. The Sun
Studio 12 compiler reports the following code, which is in the source
(gcc-4.3.1/gcc/c-common.c) of gcc 4.3.1, is a syntax error.
I'm inclined to agree, as it is like no C I have ever met.

The ## stuff is normal ISO C token pasting, so SAT ## NAME ## _type_node
would get pre-processed as fract_type_node if SAT was not set and NAME
was fract.
>what is "C_COMMON_FIXED _TYPES (, fract);" supposed to mean? Could it
be written in a different way so the Sun compiler could understand it?
Or are Sun at fault?

Hard to say.
>>
I'd certainly never write C code like this, but perhaps it is legal.

#define C_COMMON_FIXED_ MODE_TYPES(SAT, NAME) \
if (type1 == SAT ## NAME ## _type_node \
|| type1 == SAT ## u ## NAME ## _type_node) \
return unsignedp ? SAT ## u ## NAME ## _type_node \
: SAT ## NAME ## _type_node;

C_COMMON_FIXED_ TYPES (, fract); /* line 2254 */
C_COMMON_FIXED_ TYPES (sat_, fract);
C_COMMON_FIXED_ TYPES (, accum);
C_COMMON_FIXED_ TYPES (sat_, accum);


So is this really C, or is it just a GNU ism, which prevents the GNU C
compiler compiling with a compiler able to compiler C ?? I thought one
was supposed to need a C compiler to compile gcc, but perhaps I was
mistaken.

cc -c -g -DIN_GCC -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.3.1/gcc
-I../../gcc-4.3.1/gcc/. -I../../gcc-4.3.1/gcc/../include -I./../intl
-I../../gcc-4.3.1/gcc/../libcpp/include -I/usr/local/include
-I/usr/local/include -I/usr/local/include
-I../../gcc-4.3.1/gcc/../libdecnumber
-I../../gcc-4.3.1/gcc/../libdecnumber/dpd -I../libdecnumber
../../gcc-4.3.1/gcc/c-common.c -o c-common.o
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token:
short_fract_ty pe_no...

I can't see any "short" in the macro you quoted. It may be worth adding
-E to the cc flags and looking more closely at the preprocessor output.

Cheers,

Chris

I can't get anything useful from the preprocessor. Adding -E generates
tons of stuff on stdout, but it ends like this - i.e. the last appears
to be line 2253 - one line before the error.

if (type1 == integer_types [ itk_short ] || type1 == integer_types [
itk_unsigned_sh ort ])
return unsignedp ? integer_types [ itk_unsigned_sh ort ] :
integer_types [ itk_short ];
if (type1 == integer_types [ itk_long ] || type1 == integer_types [
itk_unsigned_lo ng ])
return unsignedp ? integer_types [ itk_unsigned_lo ng ] :
integer_types [ itk_long ];
if (type1 == integer_types [ itk_long_long ] || type1 ==
integer_types [ itk_unsigned_lo ng_long ])
return unsignedp ? integer_types [ itk_unsigned_lo ng_long ] :
integer_types [ itk_long_long ];
if (type1 == c_global_trees [ CTI_WIDEST_INT_ LIT_TYPE ] || type1 ==
c_global_trees [ CTI_WIDEST_UINT _LIT_TYPE ])
return unsignedp ? c_global_trees [ CTI_WIDEST_UINT _LIT_TYPE ] :
c_global_trees [ CTI_WIDEST_INT_ LIT_TYPE ];
# 2218
if (type1 == global_trees [ TI_INTTI_TYPE ] || type1 ==
global_trees [ TI_UINTTI_TYPE ])
return unsignedp ? global_trees [ TI_UINTTI_TYPE ] : global_trees
[ TI_INTTI_TYPE ];
# 2221
if (type1 == global_trees [ TI_INTDI_TYPE ] || type1 ==
global_trees [ TI_UINTDI_TYPE ])
return unsignedp ? global_trees [ TI_UINTDI_TYPE ] : global_trees
[ TI_INTDI_TYPE ];
if (type1 == global_trees [ TI_INTSI_TYPE ] || type1 ==
global_trees [ TI_UINTSI_TYPE ])
return unsignedp ? global_trees [ TI_UINTSI_TYPE ] : global_trees
[ TI_INTSI_TYPE ];
if (type1 == global_trees [ TI_INTHI_TYPE ] || type1 ==
global_trees [ TI_UINTHI_TYPE ])
return unsignedp ? global_trees [ TI_UINTHI_TYPE ] : global_trees
[ TI_INTHI_TYPE ];
if (type1 == global_trees [ TI_INTQI_TYPE ] || type1 ==
global_trees [ TI_UINTQI_TYPE ])
return unsignedp ? global_trees [ TI_UINTQI_TYPE ] : global_trees
[ TI_INTQI_TYPE ];

# 2247

# 2253
Jun 27 '08 #3
On 2008-06-10 08:28:19 +0100, Dave <fo*@coo.comsai d:
I can't get anything useful from the preprocessor. Adding -E generates
tons of stuff on stdout, but it ends like this - i.e. the last appears
to be line 2253 - one line before the error.

if (type1 == integer_types [ itk_short ] || type1 == integer_types
[ itk_unsigned_sh ort ])
return unsignedp ? integer_types [ itk_unsigned_sh ort ] :
integer_types [ itk_short ];
if (type1 == integer_types [ itk_long ] || type1 == integer_types
[ itk_unsigned_lo ng ])
return unsignedp ? integer_types [ itk_unsigned_lo ng ] :
integer_types [ itk_long ];
if (type1 == integer_types [ itk_long_long ] || type1 ==
integer_types [ itk_unsigned_lo ng_long ])
return unsignedp ? integer_types [ itk_unsigned_lo ng_long ] :
integer_types [ itk_long_long ];
if (type1 == c_global_trees [ CTI_WIDEST_INT_ LIT_TYPE ] || type1 ==
c_global_trees [ CTI_WIDEST_UINT _LIT_TYPE ])
return unsignedp ? c_global_trees [ CTI_WIDEST_UINT _LIT_TYPE ] :
c_global_trees [ CTI_WIDEST_INT_ LIT_TYPE ];
# 2218
if (type1 == global_trees [ TI_INTTI_TYPE ] || type1 ==
global_trees [ TI_UINTTI_TYPE ])
return unsignedp ? global_trees [ TI_UINTTI_TYPE ] :
global_trees [ TI_INTTI_TYPE ];
# 2221
if (type1 == global_trees [ TI_INTDI_TYPE ] || type1 ==
global_trees [ TI_UINTDI_TYPE ])
return unsignedp ? global_trees [ TI_UINTDI_TYPE ] :
global_trees [ TI_INTDI_TYPE ];
if (type1 == global_trees [ TI_INTSI_TYPE ] || type1 ==
global_trees [ TI_UINTSI_TYPE ])
return unsignedp ? global_trees [ TI_UINTSI_TYPE ] :
global_trees [ TI_INTSI_TYPE ];
if (type1 == global_trees [ TI_INTHI_TYPE ] || type1 ==
global_trees [ TI_UINTHI_TYPE ])
return unsignedp ? global_trees [ TI_UINTHI_TYPE ] :
global_trees [ TI_INTHI_TYPE ];
if (type1 == global_trees [ TI_INTQI_TYPE ] || type1 ==
global_trees [ TI_UINTQI_TYPE ])
return unsignedp ? global_trees [ TI_UINTQI_TYPE ] :
global_trees [ TI_INTQI_TYPE ];

# 2247

# 2253
Interesting - does the preprocessor exit with an error or crash?

Cheers,

Chris

Jun 27 '08 #4
Chris Ridd wrote:
On 2008-06-10 08:28:19 +0100, Dave <fo*@coo.comsai d:
>I can't get anything useful from the preprocessor. Adding -E generates
tons of stuff on stdout, but it ends like this - i.e. the last appears
to be line 2253 - one line before the error.

if (type1 == integer_types [ itk_short ] || type1 == integer_types
[ itk_unsigned_sh ort ])
return unsignedp ? integer_types [ itk_unsigned_sh ort ] :
integer_type s [ itk_short ];
if (type1 == integer_types [ itk_long ] || type1 == integer_types
[ itk_unsigned_lo ng ])
return unsignedp ? integer_types [ itk_unsigned_lo ng ] :
integer_type s [ itk_long ];
if (type1 == integer_types [ itk_long_long ] || type1 ==
integer_type s [ itk_unsigned_lo ng_long ])
return unsignedp ? integer_types [ itk_unsigned_lo ng_long ] :
integer_type s [ itk_long_long ];
if (type1 == c_global_trees [ CTI_WIDEST_INT_ LIT_TYPE ] || type1
== c_global_trees [ CTI_WIDEST_UINT _LIT_TYPE ])
return unsignedp ? c_global_trees [ CTI_WIDEST_UINT _LIT_TYPE ] :
c_global_tre es [ CTI_WIDEST_INT_ LIT_TYPE ];
# 2218
if (type1 == global_trees [ TI_INTTI_TYPE ] || type1 ==
global_trees [ TI_UINTTI_TYPE ])
return unsignedp ? global_trees [ TI_UINTTI_TYPE ] :
global_trees [ TI_INTTI_TYPE ];
# 2221
if (type1 == global_trees [ TI_INTDI_TYPE ] || type1 ==
global_trees [ TI_UINTDI_TYPE ])
return unsignedp ? global_trees [ TI_UINTDI_TYPE ] :
global_trees [ TI_INTDI_TYPE ];
if (type1 == global_trees [ TI_INTSI_TYPE ] || type1 ==
global_trees [ TI_UINTSI_TYPE ])
return unsignedp ? global_trees [ TI_UINTSI_TYPE ] :
global_trees [ TI_INTSI_TYPE ];
if (type1 == global_trees [ TI_INTHI_TYPE ] || type1 ==
global_trees [ TI_UINTHI_TYPE ])
return unsignedp ? global_trees [ TI_UINTHI_TYPE ] :
global_trees [ TI_INTHI_TYPE ];
if (type1 == global_trees [ TI_INTQI_TYPE ] || type1 ==
global_trees [ TI_UINTQI_TYPE ])
return unsignedp ? global_trees [ TI_UINTQI_TYPE ] :
global_trees [ TI_INTQI_TYPE ];

# 2247

# 2253

Interesting - does the preprocessor exit with an error or crash?

Cheers,

Chris

I don't have time to check this carefully, but as far as I can see, it
does not crash. I should have posted a bit more I think. I posted
stdout, but did npt post stderr. I've put that below, but the only
difference is the error message I previously posted.

Even IF the code is legal, it is not easy to understand. I see no reason
to try to obviscate the code, unless one is entering a competition for
such a challenge.

# 2218
if (type1 == global_trees [ TI_INTTI_TYPE ] || type1 ==
global_trees [ TI_UINTTI_TYPE ])
return unsignedp ? global_trees [ TI_UINTTI_TYPE ] : global_trees
[ TI_INTTI_TYPE ];
# 2221
if (type1 == global_trees [ TI_INTDI_TYPE ] || type1 ==
global_trees [ TI_UINTDI_TYPE ])
return unsignedp ? global_trees [ TI_UINTDI_TYPE ] : global_trees
[ TI_INTDI_TYPE ];
if (type1 == global_trees [ TI_INTSI_TYPE ] || type1 ==
global_trees [ TI_UINTSI_TYPE ])
return unsignedp ? global_trees [ TI_UINTSI_TYPE ] : global_trees
[ TI_INTSI_TYPE ];
if (type1 == global_trees [ TI_INTHI_TYPE ] || type1 ==
global_trees [ TI_UINTHI_TYPE ])
return unsignedp ? global_trees [ TI_UINTHI_TYPE ] : global_trees
[ TI_INTHI_TYPE ];
if (type1 == global_trees [ TI_INTQI_TYPE ] || type1 ==
global_trees [ TI_UINTQI_TYPE ])
return unsignedp ? global_trees [ TI_UINTQI_TYPE ] : global_trees
[ TI_INTQI_TYPE ];

# 2247

# 2253

"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token:
short_fract_typ e_node
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token:
unsigned_short_ fract_type_node
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token:
unsigned_short_ fract_type_node
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token:
short_fract_typ e_node
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token: fract_type_node
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token:
unsigned_fract_ type_node
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token:
unsigned_fract_ type_node
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token: fract_type_node
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token:
long_fract_type _node
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token:
unsigned_long_f ract_type_node
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token:
unsigned_long_f ract_type_node
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token:
long_fract_type _node
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token:
long_long_fract _type_node
"../../gcc-4.3.1/gcc/c-common.c", line 2254: fatal: too many errors
cc: acomp failed for ../../gcc-4.3.1/gcc/c-common.c

Jun 27 '08 #5
Dave wrote:
I'm having a hard time tying to build gcc 4.3.1 on Solaris using the GNU
compilers. I then decided to try to use Sun's compiler. The Sun Studio
12 compiler reports the following code, which is in the source
(gcc-4.3.1/gcc/c-common.c) of gcc 4.3.1, is a syntax error.
I'm inclined to agree, as it is like no C I have ever met.
what is "C_COMMON_FIXED _TYPES (, fract);" supposed to mean? Could it be
written in a different way so the Sun compiler could understand it? Or
are Sun at fault?
I'd certainly never write C code like this, but perhaps it is legal.

#define C_COMMON_FIXED_ MODE_TYPES(SAT, NAME) \
This macro has a different name from

>
C_COMMON_FIXED_ TYPES (, fract); /* line 2254 */
this one.

Se if you can find the correct macro definition. The errors you posted
later indicated that the preprocessor barfed, so the -E output isn't
much use.

--
Ian Collins.
Jun 27 '08 #6
Dave wrote:
I'm having a hard time tying to build gcc 4.3.1 on Solaris using the GNU
compilers. I then decided to try to use Sun's compiler. The Sun Studio
12 compiler reports the following code, which is in the source
(gcc-4.3.1/gcc/c-common.c) of gcc 4.3.1, is a syntax error.
#define C_COMMON_FIXED_ MODE_TYPES(SAT, NAME) \
if (type1 == SAT ## NAME ## _type_node \
|| type1 == SAT ## u ## NAME ## _type_node) \
return unsignedp ? SAT ## u ## NAME ## _type_node \
: SAT ## NAME ## _type_node;

C_COMMON_FIXED_ TYPES (, fract); /* line 2254 */
C_COMMON_FIXED_ TYPES (sat_, fract);
C_COMMON_FIXED_ TYPES (, accum);
C_COMMON_FIXED_ TYPES (sat_, accum);
The code invokes the macro with a missing first argument. That is valid
C99, but undefined in C90 (see the recent CLC thread on "empty macro
arguments").

It seems amazing that GCC would require C99 features to compile.

--
Thad
Jun 27 '08 #7
Thad Smith wrote:
Dave wrote:
>I'm having a hard time tying to build gcc 4.3.1 on Solaris using the
GNU compilers. I then decided to try to use Sun's compiler. The Sun
Studio 12 compiler reports the following code, which is in the source
(gcc-4.3.1/gcc/c-common.c) of gcc 4.3.1, is a syntax error.
>#define C_COMMON_FIXED_ MODE_TYPES(SAT, NAME) \
if (type1 == SAT ## NAME ## _type_node \
|| type1 == SAT ## u ## NAME ## _type_node) \
return unsignedp ? SAT ## u ## NAME ## _type_node \
: SAT ## NAME ## _type_node;

C_COMMON_FIXED_ TYPES (, fract); /* line 2254 */
C_COMMON_FIXED_ TYPES (sat_, fract);
C_COMMON_FIXED_ TYPES (, accum);
C_COMMON_FIXED_ TYPES (sat_, accum);

The code invokes the macro with a missing first argument. That is valid
C99, but undefined in C90 (see the recent CLC thread on "empty macro
arguments").

It seems amazing that GCC would require C99 features to compile.

Thank you for clearing that up. You would think they have more sence
than to do

IMHO, the gcc developers could do a lot worst than to stop adding
features and sort out why it builds so badly on many platforms - Solaris
is not the only one to have issues with gcc.

Jun 27 '08 #8
In article <48************ ***********@aut h.newsreader.oc tanews.comThad Smith <Th*******@acm. orgwrites:
....
The code invokes the macro with a missing first argument. That is valid
C99, but undefined in C90 (see the recent CLC thread on "empty macro
arguments").

It seems amazing that GCC would require C99 features to compile.
Not realy true. GCC uses the GCC compiler extensions (that in this case
emerged in C99). It is well known that during the bootstrap process the
latter stages are in general not compilable by native compilers.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
Jun 27 '08 #9
In gnu.gcc.help Thad Smith <Th*******@acm. orgwrote:
Dave wrote:
I'm having a hard time tying to build gcc 4.3.1 on Solaris using the GNU
compilers. I then decided to try to use Sun's compiler. The Sun Studio
12 compiler reports the following code, which is in the source
(gcc-4.3.1/gcc/c-common.c) of gcc 4.3.1, is a syntax error.
#define C_COMMON_FIXED_ MODE_TYPES(SAT, NAME) \
if (type1 == SAT ## NAME ## _type_node \
|| type1 == SAT ## u ## NAME ## _type_node) \
return unsignedp ? SAT ## u ## NAME ## _type_node \
: SAT ## NAME ## _type_node;

C_COMMON_FIXED_ TYPES (, fract); /* line 2254 */
C_COMMON_FIXED_ TYPES (sat_, fract);
C_COMMON_FIXED_ TYPES (, accum);
C_COMMON_FIXED_ TYPES (sat_, accum);
The code invokes the macro with a missing first argument. That is valid
C99, but undefined in C90 (see the recent CLC thread on "empty macro
arguments").
Yes, you're right. This is a bug: empty macro arguments were
undefined in C89, but it was a common extension even then. I'll fix
this.

Andrew.
Jun 27 '08 #10

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

Similar topics

45
3607
by: Steven T. Hatton | last post by:
This is a purely *hypothetical* question. That means, it's /pretend/, CP. ;-) If you were forced at gunpoint to put all your code in classes, rather than in namespace scope (obviously classes themselves are an exception to this), and 'bootstrap' your program by instantiating a single application object in main(), would that place any limitations on what you could accomplish with your program? Are there any benefits to doing things that...
67
4262
by: Steven T. Hatton | last post by:
Some people have suggested the desire for code completion and refined edit-time error detection are an indication of incompetence on the part of the programmer who wants such features. Unfortunately these ad hominem rhetorts are frequently introduced into purely technical discussions on the feasibility of supporting such functionality in C++. That usually serves to divert the discussion from the technical subject to a discussion of the...
6
2649
by: Niklaus | last post by:
Hi, Can someone point out what is wrong with this code ? How can i make it better optimize it. When run it gives me seg fault in linux. But windows it works fine(runs for a long time). Do we have something like stack size growing enormously and then saying you can't access ,so a segfault ? It would be helpful if someone can run the code and give me the output. It takes a long time on my PC.
31
2618
by: DeltaOne | last post by:
#include<stdio.h> typedef struct test{ int i; int j; }test; main(){ test var; var.i=10; var.j=20;
40
3042
by: Neo The One | last post by:
I think C# is forcing us to write more code by enforcing a rule that can be summarized as 'A local variable must be assgined *explicitly* before reading its value.' If you are interested in what I mean, please look at this feedback my me: http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=3074c204-04e4-4383-9dd2-d266472a84ac If you think I am right, please vote for this feedback.
6
2005
by: TC | last post by:
Hi. I write a program in c language that read a text file and extrapolate the word. for all word the program calculate the number of the times that word is present in the text. The problem is the REALLOC that on my pc at times it produces error. Someone can help me for this error? Thank you /*Inclusione librerie*/
1
1479
by: birgir.sigurjonsson | last post by:
Hei, I am getting compile error on the following code snip: template <typename Sclass Undef; template <typename Sclass A { public: A() {} private: Undef<Sm_s;
232
13285
by: robert maas, see http://tinyurl.com/uh3t | last post by:
I'm working on examples of programming in several languages, all (except PHP) running under CGI so that I can show both the source files and the actually running of the examples online. The first set of examples, after decoding the HTML FORM contents, merely verifies the text within a field to make sure it is a valid representation of an integer, without any junk thrown in, i.e. it must satisfy the regular expression: ^ *?+ *$ If the...
19
1773
by: Charles Sullivan | last post by:
A C program with code typified by the following pared-down example has been running after compilation on numerous compilers for several years. However with a fairly recent GCC compiler it results in a segmentation fault at the indicated instruction. Briefly, the problem occurs when writing to an array element when the array pointer is allocated by a function in the array index. My question: Is this bad C code, "unwise" C code, or a...
0
8707
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9174
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9074
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7953
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6634
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5947
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4725
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3158
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 we have to send another system
3
2110
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.