Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3947402
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:14:49+00:00 2026-05-20T01:14:49+00:00

These are the errors/warnings that g++ is putting out and below each is the

  • 0

These are the errors/warnings that g++ is putting out and below each is the relevant code. Any help with clearing these errors up or shedding some light on them would be greatly appreciated. Thank you!

g++ error:

id31.cpp: In function ‘php_var array(int, ...)’:
id31.cpp:462: warning: cannot receive objects of non-POD type ‘class php_var’ through ‘...’; call will abort at runtime
id31.cpp:480: warning: cannot receive objects of non-POD type ‘class php_var’ through ‘...’; call will abort at runtime

relevant code:

#include <stdarg.h>
php_var array(int key = 0, ...)
{
    va_list ap;
    va_start(ap, key);
    php_var arr;
    arr.to_array();
    int i = 0;
    for(int i = 0; i < key / 2; ++i)
    {
        php_var key2 = va_arg(ap, php_var);
        if(key2 == -1)
        {
            bool found = false;
            for(;;)
            {
                for(i = 0;i < arr.keys.size(); ++i)
                {
                    if(arr.keys[i] == (php_var) i)
                        found = true;
                }
                if(found)
                    ++i;
                else
                    break;
            }
            key2 = i;
        }
        php_var val = va_arg(ap, php_var);
        arr.keys.push_back(key2);
        arr.data.push_back(val);
    };
    va_end(ap);
    return arr;
}

gcc error:

id31.cpp: In function ‘php_var substr(php_var, php_var, php_var)’:
id31.cpp:511: error: ambiguous overload for ‘operator-’ in ‘str.php_var::container.std::basic_string<_CharT, _Traits, _Alloc>::length [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]() - pos’
id31.cpp:511: note: candidates are: operator-(size_t, int) <built-in>
id31.cpp:511: note:                 operator-(size_t, double) <built-in>
id31.cpp:511: note:                 operator-(size_t, float) <built-in>
id31.cpp:511: note:                 operator-(size_t, unsigned int) <built-in>
id31.cpp:511: note:                 operator-(size_t, long int) <built-in>

Relevant code:

php_var substr(php_var str, php_var pos, php_var len)
{
    if(len == 0)
        len = str.container.length() - pos;
    return (php_var) str.container.substr(pos, len);
}
php_var substr(php_var str, long pos, long len)
{
    if(len == 0)
        len = str.container.length() - pos;
    return (php_var) str.container.substr(pos, len);
}

gcc error:

id31.cpp:592: error: ambiguous overload for ‘operator-’ in ‘_length - strlen(php_var)()’
id31.cpp:592: note: candidates are: operator-(const char*, const char*) <built-in>
id31.cpp:592: note:                 operator-(const char*, int) <built-in>
id31.cpp:592: note:                 operator-(const char*, int) <built-in>
id31.cpp:592: note:                 operator-(const char*, int) <built-in>
id31.cpp:592: note:                 operator-(int, int) <built-in>
id31.cpp:592: note:                 operator-(int, double) <built-in>
id31.cpp:592: note:                 operator-(int, float) <built-in>
id31.cpp:592: note:                 operator-(int, unsigned int) <built-in>
id31.cpp:592: note:                 operator-(int, long int) <built-in>
id31.cpp:592: note:                 operator-(double, int) <built-in>
id31.cpp:592: note:                 operator-(double, double) <built-in>
id31.cpp:592: note:                 operator-(double, float) <built-in>
id31.cpp:592: note:                 operator-(double, unsigned int) <built-in>
id31.cpp:592: note:                 operator-(double, long int) <built-in>
id31.cpp:592: note:                 operator-(float, int) <built-in>
id31.cpp:592: note:                 operator-(float, double) <built-in>
id31.cpp:592: note:                 operator-(float, float) <built-in>
id31.cpp:592: note:                 operator-(float, unsigned int) <built-in>
id31.cpp:592: note:                 operator-(float, long int) <built-in>
id31.cpp:592: note:                 operator-(unsigned int, int) <built-in>
id31.cpp:592: note:                 operator-(unsigned int, double) <built-in>
id31.cpp:592: note:                 operator-(unsigned int, float) <built-in>
id31.cpp:592: note:                 operator-(unsigned int, unsigned int) <built-in>
id31.cpp:592: note:                 operator-(unsigned int, long int) <built-in>
id31.cpp:592: note:                 operator-(long int, int) <built-in>
id31.cpp:592: note:                 operator-(long int, double) <built-in>
id31.cpp:592: note:                 operator-(long int, float) <built-in>
id31.cpp:592: note:                 operator-(long int, unsigned int) <built-in>
id31.cpp:592: note:                 operator-(long int, long int) <built-in>

relevant code:

php_var _recruit = _length - (php_var)strlen(_flag);
if (_recruit < (php_var)1)
{
    return _flag;

_end_18:
    return (php_var)sprintf((string)(const char*)(php_var)"%0" + (string)(const char*)_length + (string)(const char*)(php_var)"d", _flag);

}

gcc error:

id31.cpp:598: error: cannot convert ‘std::basic_string<char, std::char_traits<char>, std::allocator<char> >’ to ‘char*’ for argument ‘1’ to ‘int sprintf(char*, const char*, ...)’

relevant code:

if (_recruit < (php_var)1)
{
    return _flag;

_end_18:
    return (php_var)sprintf((string)(const char*)(php_var)"%0" + (string)(const char*)_length + (string)(const char*)(php_var)"d", _flag);

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T01:14:50+00:00Added an answer on May 20, 2026 at 1:14 am
    1. You’re passing a php_var object as parameter for variadic function php_var array(int key = 0, ...). This is not allowed. Only POD objects can be passed as variadic parameters.

    2. and 3. There’s no operator- defined between an int (or the type of _length, don’t know what type it is) and a php_var.

    3. sprintf takes, as first argument, a char*, while you’re passing a std::string to it. Use std::string::c_str() to convert your string to a const char*

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to throw errors or warnings in a KornShell (ksh) script
I wrote this code I have these errors Cannot implicitly convert type x.Program.TreeNode' to
Many times I saw logging of errors like these: System.out.println(Method aMethod with parameters a:+a+
I have some Motif code that also uses widgets from the Xmt widget set.
I continually get these errors when I try to update tables based on another
I get errors when viewing forms and there are not any. I can close
Is there a description of the various errors that NSXMLParser can return? I'm aware
I've got a nice power-shell driven post-build script that does some magic mumbo-jumbo for
Is there a good way to debug errors in the Visual Studio Designer? In
Is there a way to make psycopg and postgres deal with errors without having

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.