def handle_userdata(graphparser):
    """ Handles the userdata argument, either create option struct or typecast to avoid compiler warning """
    if not graphparser.userdata.has_userdata:
        parsed_string = """\
    (void) userdata; /* To avoid compiler warning */\n\n"""
    else:
        parsed_string = """\
    %s_userdata_t *opts = (%s_userdata_t*)userdata;\n\n""" % (graphparser.graphname, graphparser.graphname)

    return parsed_string