- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I search information about this instruction : int c = a <? b;
A sample of code who compiled with an older version of nios2-elf-gcc (NIOS II EDS 6.0) :int foo(int a, int b)
{
int c = a <? b;
...
}
an operator ? a digrah ? what is it ? what compiler options to use with nios2-elf-gcc (NIOS II EDS 13.1) ? Thanks
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Looks like a typo, or something tried to process it in some markup language and got confused.
You'll probably have to work out what was meant from the context.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- Looks like a typo, or something tried to process it in some markup language and got confused. You'll probably have to work out what was meant from the context. --- Quote End --- This instruction exist really in the code and compile with an older version of nios2-elf-gcc (NIOS II EDS 6.0), that s not a markup or a typo :( (I do a migration of an older code which compil)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It doesn't look like valid C. The ? operator is only used in a "test ? if_true : if_false" construction. Are you sure that this code line was actually compiled with your older version of gcc? Could it be excluded with an# ifdef ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
gcc has supported some 'extensions' in the past, their use is discouraged and I don't know the syntax.
There was one for: if (x != 0); return x; And there might have been one for min/max - which could be the one you have there. With enough actual context you should be able to work out what has intended.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh yes you are right! GCC versions prior to 4.0 supported the <? (min) and >? (max) operators, as well as <?= and >?= to assign min and max values. Those were deprecated in 4.0.
You can probably replace them with MIN() and MAX() macros or functions.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- Oh yes you are right! GCC versions prior to 4.0 supported the <? (min) and >? (max) operators, as well as <?= and >?= to assign min and max values. Those were deprecated in 4.0. You can probably replace them with MIN() and MAX() macros or functions. --- Quote End --- This is consistent with the code of my application. Thank you very much.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page